loader - jquery - removing loading div after the page has loaded -
so created simple method put loader. put loader , put opacity of main container tag 0.4 . when page loads, javascript doesn't remove loader , set opacity 1. code here:
important notes:
use jquery version 2(i don't know exact)
$(document).ready(function() { $(this).load(function() { $('.progress').hide(); $('body').css("opacity", "1"); }); });
you should use $(window).load()
not $(document).load()
$(document).ready(function(){ $(window).load(function(){ alert("this can run"); }); $(this).load(function(){ alert("this cannot run"); }); $(document).load(function(){ alert("this cannot run too"); }); })
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
Comments
Post a Comment