开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜