2011-04-24 40 views
0
$.swapImage.swapOut = function() { 
     if ($(this).find('.popup').is(':visible') !== true) 
{ 
    alert(ASDASD) 
    $.swapImage.swap(this, "sout"); 
} 

我試圖找到,如果格「彈出+本」(例如popup1)是在完成動作之前可見。任何我的想法?的javascript:完成動作只有一個div可見

+0

不知道我理解。你可以發佈一些你的HTML嗎? – 2011-04-24 02:39:14

回答

0

嘗試:

if ($(this).find('.popup:visible').length > 0) 
+1

'> 0'有點多餘;如果不存在,則長度將爲「0」。 – Reid 2011-04-24 02:42:41

+1

夠公平 - 我想我會更清楚一點。 – jmans 2011-04-24 02:46:02