1

我一直在尝试在我的页面加载时显示图像。但正如您在屏幕截图中看到的那样,页面在图像之前加载。可能是因为顺序。

在此处输入图像描述

    <head>
    <meta http-equiv="X-UA-Compatible" content="IE=EDGE"/>
    <style>
    div#loading {
        top: 200 px;
        margin: auto;
        position: absolute;
        z-index: 1000;
        width: 160px;
        height: 24px;
        background: url(/images/loadingM.gif) no-repeat;
        cursor: wait;
        }
    </style>
    </head>
<body><div id="loading"></div></body>

在页面底部我使用了这个脚本

window.onload = function(){ document.getElementById('loading').style.display='none';}

但是我的页面没有在内容之前加载。因此,简而言之,我在页面加载时看不到加载图像。

4

0 回答 0