1.判断display是否显示和隐藏
$("#ID").is(":visible")==true表示显示false表示隐藏

 if ($("#ulZX").is(":visible")) {
                $("#ulZX").slideUp("normal");
            }
            else {
                $("#ulZX").slideDown("normal");
            }  

2.Jquery显示和隐藏切换
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">

        function TLZ(th) {
            $(th).siblings("ul").toggle();     
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <span  onclick="TLZ(this)" >asdffffffffffff</span>
    <ul style=" display:none" >
       <li>123</li>
       <li>456</li>
       <li>789</li>
       <li>asd</li>
    </ul>

    </div>
    </form>
</body>
</html>     

3.查找上一个,第一个img
$(th).prev().find("img:first").attr("src", "Images\\arrows_right.png");
//查找父级下面的第一个
 $(th).parent().find('img').first().attr("src", "Images\\icon_01.png")

 

 

 

 

 

 

 

 

 


 

posted on 2012-07-19 15:36  成天狂  阅读(4138)  评论(0编辑  收藏  举报