开发者

<body onload="function()"> makes my animatedImage stuck

开发者 https://www.devze.com 2023-02-25 21:18 出处:网络
I have a preload page with an animation. <body onload=\"showSpinner()\"> <h3>Please Wait...</h3>

I have a preload page with an animation.

<body onload="showSpinner()">
    <h3>Please Wait...</h3>
    <s开发者_StackOverflow中文版cript>        
    function showSpinner() {
        showProgress();                      
        window.location.href = 'Report.aspx'; 
    }      
    </script>
</body>

When my function gets accessed and window.location.href fires, the animation freeze. Is there a way to prevent this?


There is no way to control the "freeze" in your animation.

The moment you are changing the location of the page, the browser fetches the new page and stops all processing of the current page, including animations. IIRC, this behaviour is not consistent across browsers.

0

精彩评论

暂无评论...
验证码 换一张
取 消