how to add page load animation

first add jquery.min.js cdn in head

after add style on head file
<style type="text/css">
  .loader {
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background: url('assent/dist/img/loading.gif') 50% 50% no-repeat rgb(249,249,249);
    opacity: .8;
}
</style>

after add javascript before body tag:

<script>$(window).on('load', function(){ 
    $(".loader").fadeOut("slow");
});</script>

after add this code after body tag:

  <div class="loader"></div>

Comments

Popular posts from this blog

Displaying a flash message after redirect in Codeigniter

What is required for it startup company ?

how to export html data to pdf in angularjs and javascript