简体   繁体   中英

Want to load Spinner Loading Animator till the Page loads

The Problem is my project contains a navigator which slides to different content on click of a arrow image. But when the page loads the first time the spinner works properly.

<script type="text/javascript">
        function stopSpinner() {
            $('.spinnerImage').fadeOut(6000);
        }
    </script>
</head>
<body onload="stopSpinner()">
    <div class="spinnerImage"></div>

How can I use to get the spinner animator for each slide. I am not able to use the function "stopSpinner()" on click of a arrow image.

<img src="../Images/Next.png" class="IconHWidth" onclick="slidepage('next');stopSpinner();" />

I want to achieve the same functionality on click of a arrow so that the spinner shows up for each slide.I am using the master page so that it applies to all the aspx pages. Please suggest the method to resolve this

The load event on the body fires when all assets of the document have been loaded, therefore just once per document load. If you want a spinner for each image that gets loaded, you need to fade in the spinner again with the call of slidepage('next') . And then you need to attach the stopSpinner callback to the onload -handler of your next image instead of the body.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM