简体   繁体   English

想要加载Spinner Loading Animator直到页面加载

[英]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. 单击箭头图像后,我无法使用功能“ stopSpinner()”。

<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. 我想通过单击箭头来实现相同的功能,以便为每个幻灯片显示微调框。我正在使用母版页,以便将其应用于所有aspx页。 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. load文档的所有资产后,主体上的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') . 如果要为加载的每个图像使用微调器,则需要通过调用slidepage('next')再次淡入微调器。 And then you need to attach the stopSpinner callback to the onload -handler of your next image instead of the body. 然后,您需要将stopSpinner回调附加到下一个图像的onload -handler而不是主体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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