Funciones Javascript para cuando cargue el sitio web

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.