lilo
1 month ago

How to stop animation while page is loading

Posted 1 month ago by lilo

Hi,

I wanted to display an animation until the page loads completely but the icon doesn't stop and the page doesn't load successfuly. How can I fix this?

Here is my index page:

<head>
    ....
</head>
<style>
    .no-js #loader { display: none;  }
    .js #loader { display: block; position: absolute; left: 100px; top: 0; }
    .se-pre-con {
        position: fixed;
        left: 0px;
        top: 0px;
        width: 100%;
        height: 100%;
        z-index: 9999;
        background: url(https://smallenvelop.com/wp-content/uploads/2014/08/Preloader_11.gif) center no-repeat #fff;
    }
</style>
<script>
    $(window).on(‘load’, function() {
        // Animate loader off screen
        $(“.se-pre-con”).fadeOut(“slow”);
    });
</script>
<body class="scroll-assist">    
 <div class="se-pre-con">
   ..........

Please sign in or create an account to participate in this conversation.