How can I make a hidden div activate (or unhide) If a certain Div is taking longer than 30 seconds to completely load all elements within it?
I can't figure out a code.
How can I make a hidden div activate (or unhide) If a certain Div is taking longer than 30 seconds to completely load all elements within it?
I can't figure out a code.
Assuming your HTML looks something like this
<body>
<img src="...">
</body>
you could do something like this:
<body>
<script type="text/javascript">slowTimer = setTimeout(function() { $("#slowLoadingDiv").show(); }, 30000)</script>;
<img src="...">
<script type= "text/javascript">clearTimeout(slowTimer);</script>
</body>
Basically, before your "slow loading" code, you start a timer, and when it fires you do something. After the DOM loads, you cancel said timer.