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


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");

ÃßõÃßõ : 307 Ãßõ ¸ñ·Ï
¹øÈ£ Á¦¸ñ
365
jQuery.get() HTTP GET ¹æ½Ä Ajax ¿äû
364
jQuery.post(), Ajax HTTP POST ¹æ½Ä ¿äû
363
jQuery.getJSON, JSON µ¥ÀÌÅ͸¦ ·Îµå
362
jQuery length¿Í slideToggle ¿¹Á¦
361
[CSS] before¿Í after ¼±ÅÃÀÚ¸¦ ÀÌ¿ëÇÏ¿© Float ¼Ó¼º ÇØÁ¦
360
jQuery toggleClass() Methods
359
jQuery stop(),Callback,Chaining
358
jQuery Effects - Animation
357
jQuery Effects - Sliding
356
jQuery fadeIn(), fadeOut(), fadeToggle(), fadeTo()
jQuery hide(), show(), toggle()
354
jquery trigger(), ÇÔ¼ö ½ÇÇà½ÃÅ°±â
353
Æú´õ¾ÈÀÇ ÆÄÀÏ °¡Áö°í ³î±â
352
ÆÄÀ̽㿡¼­ À¯´ÏÄÚµå ½ºÆ®¸² ´Ù·ç±â
351
Python 2.x ÇÑ±Û ÀÎÄÚµù °ü·Ã Á¤¸®
350
htmlspecialchars, entity decode
349
Php : Finding Chrome and Safari Browsers
348
[Shoutcast] jPlayer and Shoutcast Configuration
347
[Shoutcast] ÇöÀç Ç÷¹À̵Ǵ °î¸í ½ºÅ©¸³Æ® PHP
346
[Shoutcast] ½ºÆ®¸®¹Ö ³ë·¡Á¦¸ñÀ» º¯°æ ½ºÅ©¸³Æ®
345
Shoutcast PHP Scripts
344
FTP¿¡¼­ »èÁ¦ ¾ÈµÇ´Â ÆÄÀÏÀ̳ª Æú´õ »èÁ¦Çϱâ
343
DAUM ¿ìÆí¹øÈ£ ¼­ºñ½º È°¿ëÇϱâ
342
jquery checkbox Àüü ¼±ÅÃ, Àüü ÇØÁ¦, üũ °ª ÃßÃâ
341
Setting .htaccess to allow PHP to be accessed with .xml extension
340
jQuery API: Manipulation, Events, Effects, Internals, Utilities
339
[Android] Intent È°¿ë ¿¹½Ã
338
HTML5 °ü·Ã À¯¿ëÇÑ ·¹ÆÛ(ÂüÁ¶) »çÀÌÆ®
337
IE6~7 ¹®Á¦ÇØ°á
336
³ª´®°íµñ ±¸±Û À¥ÆùÆ®(Webfont) »ç¿ëÇϱâ
¸ñ·Ï
¹ÂÁ÷Æ®·ÎÆ® ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ °¡¾ßµ¿ ¤Ó °³ÀÎÁ¤º¸Ãë±Þ¹æħ
Copyright ¨Ï musictrot All rights reserved.