nextAll(), nextUntil() ¸Þ¼µå¸¦ ÀÌ¿ëÇÑ ±º´ëƽÇÑ ³»¹«¹Ý ¿¹Á¦¡Ø ³»¿ë ¾÷µ¥ÀÌÆ®¿Í ȨÆäÀÌÁö °ü¸® ´Ù½Ã ½ÃÀÛÇÏ°Ú½À´Ï´Ù. ^^;
|
|||
|
|||
¿¹Á¦
|
|||
¼Ò½º
<style type="text/css"> #hq { width:800px; margin:0 auto; text-align:center; margin-top:20px; } #hq img { position:relative; cursor:pointer; margin:3px; } </style> <img src="http://biketago.com/img/etc/huk2.gif" style="display:none;"> <div id="hq"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> <img src="http://biketago.com/img/etc/huk1.gif"> </div> <br><br> ³»¹«¹Ý¿¡ º´»çµéÀÌ ½¬°í ÀÖ½À´Ï´Ù. ¿ÞÂÊ ºÎÅÍ °è±ÞÀÌ ³ô½À´Ï´Ù. º´ÀåºÎÅÍ À̵±îÁö~ ¾Æ·¡ ¹öÆ°À» ´·¯º¸¼¼¿ä. <div style="text-align:center; margin-top:40px;"> <button type="button" onclick="attention ($('#hq img') )">ÀüºÎ ÁÖ¸ñ !!</button> <button type="button" onclick="attention( $('#hq img:eq(1)').nextAll() )">³» ¹ØÀ¸·Î ´Ù ÁÖ¸ñ !!!</button> <button type="button" onclick="attention( $('#hq img:eq(1)').nextUntil($('#hq img:eq(7)')))">³» ¹ØÀ¸·Î ³Ê À§·Î ´Ù ÁÖ¸ñ !!!</button> <button type="button" onclick="attention( $('#hq img:last') )">¸·³»¾ß!</button> <button type="button" onclick="setTimeout(function(){attention( $('#hq img:first') )}, 500)">¿©±â ¿Õ°í ´©±¸?</button> <button type="button" onclick="attention( $('#hq img').eq(-6).nextAll() )">³»°¡ ¹äÀÌ ¾ÈµÈ´Ù 5¸í!!</button><br> <button type="button" onclick="wave()">ÀοøÆÄ¾Ç : ¹øÈ£½ÃÀÛ !! ~~</button> </div> <br> ±º´ë¿¡¼ ÀÖÀ»¹ýÇÑ ¿¹Á¦ÀÔ´Ï´Ù. ^^; <script type="text/javascript"> var timer; function attention(j){ clearTimeout(timer); j.attr('src', 'http://biketago.com/img/etc/huk2.gif'); timer = setTimeout(function(){ $('#hq img').attr('src', 'http://biketago.com/img/etc/huk1.gif'); }, 1000); } // ÀοøÆÄ¾Ç - ¼øÂ÷Àû À̹ÌÁö º¯°æ function wave(){ var timer = 100; // each ¸Þ¼µå¸¦ ÀÌ¿ëÇؼ ¼øÂ÷ÀûÀ¸·Î ¹Ù²ãÁÖ±â $('#hq img').each(function(){ var o = this; setTimeout(function(){ $(o).attr('src', 'http://biketago.com/img/etc/huk2.gif'); }, timer); setTimeout(function(){ $(o).attr('src', 'http://biketago.com/img/etc/huk1.gif'); }, timer + 300); timer += 500 }); } function wait(j){ var move = Math.round(Math.random() * 3) + 1; var time = Math.round(Math.random() * 500) + 500; $(j).animate({top:'-=' + move}, time, function(){ $(j).animate({top:'+=' + move}, time, wait(j)); }); } // °¢ À̹ÌÁö¸¶´Ù wait ÇÔ¼ö¸¦ ½ÇÇà (À§¾Æ·¡·Î ¿òÁ÷À̵µ·Ï) $('#hq img').each(function(){ wait(this); }); </script> |
|||
°ü·Ã±Û ¸ðÀ½ (Á¦ÀÌÄõ¸® ¾Ö´Ï¸ÞÀÌ¼Ç ¿¹Á¦ ¸ðÀ½)
|
|||
|