jquery点击来回切换img图片的src指定元素的高度显示与隐藏
程序员文章站
2024-01-07 17:44:34
...
$(".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");
}
})