check if jquery reveal modal is active, do something
问题 I am trying to run some javascript ONLY on the condition that the reveal modal is active. The problem is that the methods I have tried have been True whether the modal is active or not. Below is an example of what I am trying to accomplish. I have tried :is visible method, also :active. I am using zurb reveal modal. The html: <div id="myModal" class="reveal-modal"> <ul> <li>some list item</li> <li>some list item</li> </ul> </div> <!--/myModal--> The JS: <script> if ($('#myModal:active')