日期:2014-05-16  浏览次数:20373 次

获取$this子元素的方法
需要更改子元素的display属性,网上找了两种方法均无效,特来求解
第一种方法

     $(document).on("mouseover",".cl", function(){
 
                   $(this).attr({"style":"background: #f8f8f8;"});//这个有效
                     $(this).children("span").attr({"style":"display:none;"});

 
                 });



第二种方法
   


  $(document).on("mouseover",".cl", function(){
 
                   $(this).attr({"style":"background: #f8f8f8;"});//这个有效
                  
 var olimgurl = $(this).find("span").attr();
 $(this).find(".huifu").css({ "style": "display:none;"});
 
                 });

需要达到的下过就是鼠标移动到.cl上,子元素.huifu的display属性改变
------解决方案--------------------
$(this).find(".huifu").hide()即可