天天看點

jqurey 隐藏

1.

$("#test").hide();     //jQuery 的 hide() 函數,隐藏 id="test" 的元素。

2.

$(".test").hide();      //jQuery 的 hide() 函數,隐藏所有 class="test" 的元素。

3.

 $("#div1").fadeOut();      //jQuery fadeout() 函數,淡出

$("#div2").fadeOut("slow");

$("#div3").fadeOut(1000);

4.  

$("p").click(function(){      //“<p>點選我,我會消失</p>”點選會消失

    $(this).hide();

  });

5.//一個css樣式

<style type="text/css">

div.ex

{

background-color:#e5eecc;

padding:7px;

border:solid 1px #c3c3c3;

}

</style>

<div class="ex">

<p>聯系人:張先生<br />

</div>

繼續閱讀