jquery点击来回切换img图片的src指定元素的高度显示与隐藏

$(".clickMore img").click(function(){
        if($(this).attr('src')=='/resource/component/kms/img/moreIcon.png'){
            $(this).attr('src','/resource/component/kms/img/lessIcon.png');
            $(this).parents("div.ssfl").css("height","auto");
        }else{
            $(this).attr('src','/resource/component/kms/img/moreIcon.png');
            $(this).parents("div.ssfl").css("height","30px");
        }
    })
发布了25 篇原创文章 · 获赞 0 · 访问量 589

猜你喜欢

转载自blog.csdn.net/luyundesign/article/details/103805987