如果#shareImg显示,则打印1111,不显示打印222,该怎么做判断
$("#shareImg").show();
使用jQuery判断元素是否可见:
if ($("#sharelmg").is(":visible")) { console.log("1111"); } else { console.log("222"); }