force Javascript to not execute till display ="inline"
I've got a program which contains 2 div's. Depending on the user at any 开发者_如何学JAVAgiven time 1 of the div's is visible. Is it possible to stop my entire <script </script>
from executing on till the div which it is in is set to display="inline"
?
Not directly no. But with jQuery, you could override the hide/show functions so that they fire custom events "onshow" and "onhide", then you could bind event handlers to these events to run various code when those events fire.
精彩评论