reiniger Posted January 28, 2011 Report Share Posted January 28, 2011 (edited) Sveiki. Ielādēju lapā visus attēlus un ta lai no mazam bildītēm var pārslēgt lielās bildītes. function pictureChangeID(id, value){ $('div#small_gal').hide("fast", function () { $('#gal_smal'+id).show(); }); html <ul> <li><a onclick="pictureChangeID(1);"><img src="/thumb1.jpg" alt="" height="52" width="79" /></a></li> <li><a onclick="pictureChangeID(2);"><img src="/thumb2.jpg" alt="" height="52" width="79" /></a></li> <li><a onclick="pictureChangeID(3);"><img src="/thumb3.jpg" alt="" height="52" width="79" /></a></li> </ul> <div id="small_gal"> <div id="gal_smal1" style="display: none;" > <a href="bilde1" class="pirobox" title=""><img src="bilde1.jpg" alt="" /></a> </div> <div id="gal_smal2" style="display: none;" > <a href="bilde2" class="pirobox" title=""><img src="bilde2.jpg" alt="" /></a> </div> <div id="gal_smal3" style="display: none;" > <a href="bilde3" class="pirobox" title=""><img src="bilde3.jpg" alt="" /></a> </div> </div> Patreic vienalga viss tiek paslēpts. Ja lietoju tikai show tad parad bildi un parejas ar nak klat ja uzklikšķina uz thum bildi. Ka panakt lai parejas tiek pasleptas un parads tikai konkrētā bilde? Edited January 28, 2011 by reiniger Quote Link to comment Share on other sites More sharing options...
0 codez Posted January 28, 2011 Report Share Posted January 28, 2011 (edited) http://jsfiddle.net/LdvDx/1/ Eventus vajag definēt ar js. html: <ul class="thumbs"> <li><img src="http://www.freewebs.com/adr3naline/dodge-challenger-1970a.jpg" thumbfor="b1" /></li> <li><img src="http://www.ecosherpa.com/images/dynasty_car.jpg" thumbfor="b2" /></li> <li><img src="http://static.howstuffworks.com/gif/race-cars-2025-1.jpg" thumbfor="b3" /></li> </ul> <div id="large"> <img id="b1" src="http://www.freewebs.com/adr3naline/dodge-challenger-1970a.jpg" alt="" /> <img id="b2" src="http://www.ecosherpa.com/images/dynasty_car.jpg" alt="" /> <img id="b3" src="http://static.howstuffworks.com/gif/race-cars-2025-1.jpg" alt="" /> </div> css: .thumbs li{ display:inline-block; } .thumbs li img{ width:64px; height:64px; border:1px solid #888; display:inline-block; cursor:pointer; } #large img{ display:none; } #b1{border:1px solid #f00} #b2{border:1px solid #0f0} #b3{border:1px solid #00f} js: $(function(){ $('.thumbs img').bind('click',function(){ iid=$(this).attr('thumbfor'); $('#large img').hide(); $('#'+iid).show(); }); }); Edited January 28, 2011 by codez Quote Link to comment Share on other sites More sharing options...
0 reiniger Posted January 28, 2011 Author Report Share Posted January 28, 2011 Milzīgs paldies. Quote Link to comment Share on other sites More sharing options...
Question
reiniger
Sveiki.
Ielādēju lapā visus attēlus un ta lai no mazam bildītēm var pārslēgt lielās bildītes.
Patreic vienalga viss tiek paslēpts.
Ja lietoju tikai show tad parad bildi un parejas ar nak klat ja uzklikšķina uz thum bildi.
Ka panakt lai parejas tiek pasleptas un parads tikai konkrētā bilde?
Edited by reinigerLink to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.