HTML
<li class="fb_pmItem fb_pmItemNum2 wximg" >
<div class="fb_pmImg" style="background-position:0 -220px;" ></div>
<img src=" __PUBLIC__/img/wximg.png" id="img" style=" display: inline; position: fixed; top: 12%; left: 0%;">
<p class="fb_pmTitle">微信支付</p>
<div class="fb_pmChosenImg " ></div>
</li>
JS
<script>
$(function(){
// 默认显示隐藏
$("#img").hide();//默认隐藏
$(".wximg").click(function(){ //点击
// 发现div 监测如果显示就让他隐藏
var obj=$(this);//当前对象
if(obj.hasClass('ishow_a')){
obj.removeClass('ishow_a');
obj.children("#img").hide();
// 兄弟级 next() siblings()
// 孩子级 children()
// 父级 parent()
console.log(2)
}else{
console.log(1)
// 发现div 监测如果隐藏就让他显示
obj.addClass('ishow_a');
obj.children("#img").show();
// obj.siblings('.i_position_content_text_p').siblings('.i_position_conceal').show();
}
})
})
</script>