ȸ¿ø°¡ÀԡžÆÀ̵ð/ºñ¹øã±â
ȨÀ¸·Î

jQuery hide(), show(), toggle()
8³â Àü
hide() ±â´ÉÀº ¹®±¸¸¦ ¼û±â´Â ±â´ÉÀ» ÇÕ´Ï´Ù.
show() ±â´ÉÀº ¹®±¸¸¦ º¸¿©ÁÖ´Â ±â´ÉÀ» ÇÕ´Ï´Ù.

$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});


°ü·Ã¿¹Á¦

<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
});
</script>
</head>
<body>
<p>¹öÆ°À» Â÷·ÊÂ÷·Ê Ŭ¸¯Çغ¸½Ã±â ¹Ù¶ø´Ï´Ù.</p>
<button id="hide">¼û°Ü¶ó</button>
<button id="show">º¸¿©Áà¶ó</button>
</body>
</html>

// ¹öÆ°ÀÇ id°ª hide¸¦ Ŭ¸¯ÇÏ¸é ¹®±¸°¡ ¾ø¾îÁö´Â Çö»óÀÌ ³ªÅ¸³²
// ¹öÆ°ÀÇ id°ª show¸¦ Ŭ¸¯ÇÏ¸é ¹®±¸°¡ ³ªÅ¸³ª´Â Çö»óÀÌ ³ªÅ¸³²


hide() ¿Í show() ¿¡ Á»´õ ±â´ÉÀ» Ãß°¡ÇÏ¸é ´õ ¸ÚÁø È¿°ú¸¦ º¼ ¼ö ÀÖ½À´Ï´Ù.

$("#hide").click(function(){
$("p").hide(1000);
});
$("#show").click(function(){
$("p").show(1000);
});

// Á¶±Ý Ʋ·ÁÁø Á¡Àº "()" ¾È¿¡ ¼ýÀÚ°¡ µé¾î°¡ Àִ°ÍÀ» È®ÀÎ ÇÒ ¼ö ÀÖ½À´Ï´Ù.

// 1000Àº 1Ãʸ¦ ÀǹÌÇϸç, 1ÃÊ µ¿¾È »ç¶óÁö°í, º¸¿©Áö´Â Çö»óÀÌ ³ªÅ¸³³´Ï´Ù.



°ü·Ã¿¹Á¦

<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#hide").click(function(){
$("p").hide(1000);
});
$("#show").click(function(){
$("p").show(1000);
});
});
</script>
</head>
<body>
<button id="hide">¼û°Ü¶ó</button>
<button id="show">º¸¿©Áà¶ó</button>
<p>ù¹ø° ¹®ÀåÀÔ´Ï´Ù.</p>
<p>µÎ ¹ø° ¹®ÀåÀÔ´Ï´Ù..</p>
</body>
</html>

// À§ ³»¿ëÀº À̹ÌÁö º¸´Ù´Â Á÷Á¢ ÄÚµùÀ» Çؼ­ ¾î¶²Çö»óÀÌ ³ªÅ¸³ª´ÂÁö È®ÀÎ ÇϽñ⠹ٶø´Ï´Ù.

// ±×¸®°í ¼ýÀÚ¸¦ 1000, 2000 ¹Ù²ã°¡¸ç Çغ¸½Ã°í ³ª¸§´ë·Î ÄÚµùµµ ¼öÁ¤ÇÏ¿© Çغ¸½Ã±â ¹Ù¶ø´Ï´Ù. ^^




toggle()

toggle() Àº ¾î¶² ³»¿ë ¶Ç´Â ¿ä¼Ò¸¦ ¼û±â°í, ³ªÅ¸³»´Â ±â´ÉÀ» µ¿½Ã¿¡ ¼öÇà ÇÕ´Ï´Ù. Áï, hide(), show() ±â´ÉÀ» Çϳª·Î ¹­¾î³õÀº ÇÔ¼öÀÔ´Ï´Ù.


$("button").click(function(){
$("p").toggle();
});




°ü·Ã¿¹Á¦

<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$("p").toggle();
});
});
</script>
</head>
<body>

<button>Toggle</button>
<p>ù¹ø° ¹®±¸ ÀÔ´Ï´Ù.</p>
<p>µÎ ¹ø° ¹®±¸ÀÔ´Ï´Ù.</p>
</body>
</html>

toggle() ÇÔ¼öµµ ¸¶Âù°¡Áö·Î °ýÈ£() ¾È¿¡ ¼ýÀÚ(1000) µîÀ» ³Ö¾î ¾Ö´Ï¸ÞÀÌ¼Ç È¿°ú¸¦ ÁÙ¼ö ÀÖ½À´Ï´Ù. ±×¸®°í ÇÔ¼ö "slow" , "fast" µîÀ» ³Ö¾î ¶Ç ´Ù¸¥ ¾Ö´Ï¸ÞÀÌ¼Ç È¿°úµµ °¡´ÉÇÕ´Ï´Ù.

$(selector).toggle(1000);

$(selector).toggle("slow");

$(selector).toggle("fast");

ÃßõÃßõ : 305 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
2,765
ÀÚ¹Ù½ºÅ©¸³Æ® ¿¬½À ¿¹Á¦ - ·£´ýÇÏ°Ô ¿òÁ÷ÀÌ´Â ÅؽºÆ® ¸¸µé±â
2,764
jQuery Mobile¿¡¼­ À¯¿ëÇÑ ÄÚµå 10°¡Áö
2,763
ÀÚ¹Ù½ºÅ©¸³Æ®·Î º¹»çÇϱ⠱â´É ±¸ÇöÇϱâ
2,762
[JqueryMobile] - Jquery Mobile È­¸é °­Á¦ ȸÀü
2,761
jQuery – ½º¸¶Æ®Æù ½ºÅ©¸° ȸÀü °¨Áö ½ºÅ©¸³Æ®
2,760
javascript audioÆÄÀÏ Àç»ý
2,759
javascript º¯¼ö scope shadowing Ŭ·ÎÀú
2,758
javascript ¹Ýº¹¹®
2,757
javascript Á¶°Ç¹®
2,756
javascript ¹è¿­
2,755
javascript ¿¬»êÀÚ¿Í ÇÔ¼ö
2,754
javascript ÀÚ·áÇü
2,753
javascript º¯¼ö
2,752
[jQuery] animate()¿¡¼­ stop()ÀÇ Á߿伺
2,751
javascript audioÆÄÀÏ Àç»ý
2,750
[jQuery.$ajax]mysql + php ¼­¹ö¿¡¼­ json µ¥ÀÌÅÍ ¾ò¾î¿À±â
2,749
Daum¿¡¼­ »ç¿ëÇÏ°í ÀÖ´Â ¸¶¿ì½º ¿À¸¥ÂÊ »ç¿ë ±ÝÁö ½ºÅ©¸³Æ®
2,748
MP3 ¸µÅ©½Ã ½ºÆ®¸®¹Ö µÇÁö ¾Ê°í ´Ù¿î·Îµå µÇµµ·Ï ¸¸µé±â
2,747
jQuery ºñµ¿±â Ajax Åë½ÅÀ» Çغ¸ÀÚ!! - JSON¹æ½Ä
2,746
[jQuery] load ¸¦ ÀÌ¿ëÇÑ ½Ç½Ã°£ ÆäÀÌÁö °¡Á®¿À±â
2,745
[jQuery]ºñµ¿±âÀûÀ¸·Î JSONÆÄÀÏ ·Îµå
2,744
[jQuery]µ¿ÀûÀ¸·Î ¿ø°Ý ÆäÀÌÁö ·Îµå
2,743
[jQuery]¿öÅ͸¶Å© ÅؽºÆ®¹Ú½º ÄÁÆ®·Ñ ±¸Çö
2,742
[jQuery]Æ®¸®ºä ÄÁÆ®·Ñ
2,741
[jQuery]¾Ö´Ï¸ÞÀÌ¼Ç È¿°ú ¸ØÃß±â - stop()
2,740
[jQuery]¿©·¯°¡Áö È¿°ú µ¿½Ã ó¸® - animate()
2,739
[jQuery]½½¶óÀÌµå ¾÷
2,738
[jQuery]½½¶óÀÌµå ¾÷/´Ù¿î - slideToggle()
2,737
[jQuery] scroll down °ú scroll up ÇÒ¶§ À̺¥Æ® Àû¿ë½ÃÅ°±â
2,736
[jQuery]addClass() : ½ºÅ¸ÀÏ Ãß°¡ [removeClass()]
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.