<div id="chatCenterMembers">
<div class="chatmember">
<a title="Blah Blah Blah">
<div class="newchatmessage" style="display: block;"></div>
如何捕获if语句中的可见div?jQuery if visible
我有$(this)
设置为<div class="chatmember">
- 从顶部的第二行。
我一直在下面工作,但现在运气到目前为止。
if($(this+' a div.newchatmessage').filter(":visible")) {
以上只是滴出...
我也试过以下,并没有对这种方法的任何详细资料工作,要么
if ($(this + 'a div.newchatmessage').is(':visible')) {
那里的div与类newchatmessage? – Shef
@Wesley你可能是对的......但'this'可能不是一个jQuery变量,所以我想'$('一个div.newchatmessage',$(this))' –
Oops删除我的评论太快了,我似乎记得之前使用过这种语法,但我不确定。 –