怎么理解下面的代码?
$(".classa",$box).die().live("click",function(){
//....
}).css({zIndex:"99"});

解决方案 »

  1.   

    $(".classa",$box).die().live("click",function(){
    //....
    }).css({zIndex:"99"});
    这个意思是 查找所有包含样式是classa的元素,
    1.die() 删除它绑定的事件
    2.live("click",function(){}) 添加上click事件
    3.把它们的CSS zIndex设置为99$box这个不知道
      

  2.   

    Remove all event handles added with the live() method 
      

  3.   

    嗯,谢谢
    看还有没有人能解释下$box这个
    $box = $('#Wtuparent');
    但是
    $(".classa",$box)
    JQUERY选择器不能这样子用吧?
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="jquery-1.4.4.min.js"></script>
    <script type="text/javascript">
    <!--
    $(window).load(function(){
    $a = $('#Wtuparent');
    $('.classa',$a).die().live("click",function(){
    alert('111');
    $(this).css({zIndex:"1"});
    }).css({zIndex:"99"});
    });
    //-->
    </script>
    <title>无标题文档</title>
    </head><body>
    <div id="Wtuparent" style=" clear:both; height:40px; text-align:center">
         <a  href="#">aa</a><br/>
            <span class="classa" style=" display:block; padding:3px; cursor:pointer;">bb</span>
        </div>
        <div style=" clear:both; height:40px; text-align:center">
         wwwwwwwwwwwwww
        </div>
    </body>
    </html>