2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<script type="text/javascript">
$(function() {
$('body').removeClass('loaded');
});
$(document).ready(function(){
//$(".loaded").hide();
$("#main_content_wrap").css('display', 'block');
$('body').addClass('loaded');
//$(".loaded").show();
});
</script>
Document.ready (a jQuery event) will fire when all the elements are in place, and they can be referenced in the JS code, but the content is not necessarily loaded. Document.ready executes when HTML-Document is loaded
$(document).ready(function() {
// code to be executed
alert("document is ready");
});
The window.load however will wait for the page to be fully loaded, this includes inner frames, images etc.
$(window).load(function() {
//Fire when page is loaded completely
alert("window is loaded");
});
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.