强制Javascript不执行直到显示=“内联” [英] force Javascript to not execute till display ="inline"
本文介绍了强制Javascript不执行直到显示=“内联”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含2个div的程序。根据用户在任何给定的时间1的div是可见的。是否可以停止我的整个< script< / script>
,直到它所在的div设置为 display = inline
?
I've got a program which contains 2 div's. Depending on the user at any given 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"
?
推荐答案
但是使用jQuery,您可以重写隐藏/显示功能,以便他们触发自定义事件onshow和onhide,然后你可以绑定事件处理程序到这些事件运行各种代码,当这些事件。
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.
这篇关于强制Javascript不执行直到显示=“内联”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文