<span style="font-family: Arial, Helvetica, sans-serif;"><body id="bodyId"></span></span><div class="bg"></div>
<div id="content" class="content">
<img src="<%=basePath%>img/115223_oFLD_1163935_thumb.gif" />正在<span style="font-family: Arial, Helvetica, sans-serif;">弄1</span><span style="font-family: Arial, Helvetica, sans-serif;">,请稍后。。。。。</span>
</div>
<div id="content1" class="content1">
<img src="<%=basePath%>img/115223_oFLD_1163935_thumb.gif" />正在<span style="font-family: Arial, Helvetica, sans-serif;">弄2</span><span style="font-family: Arial, Helvetica, sans-serif;">,请稍后。。。。。</span>
</div>
<div id="content2" class="content2">
<img src="<%=basePath%>img/115223_oFLD_1163935_thumb.gif" />正在弄3,请稍后。。。。。
</div>
<div id="content3" class="content3">
<img src="<%=basePath%>img/115223_oFLD_1163935_thumb.gif" />正在弄4,请稍后。。。。。
</div>
<form action="" name="formlist" id="_from">
js:
$('.bg').fadeIn(200);
$('.content2').fadeIn(400);
样式:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>样式</title>
<style type="text/css">
.bg{
display:none;
position:fixed;
width:100%;
height:100%;
background:#909090;
z-index:2;
top:0;
left:0;
opacity:0.7;
}
.content,.content1,.content2,.content3{
border:5px solid #939393;
line-height:55px;
padding:0 20px;
display:none;
width:250px;
height:50px;
position:fixed;
top:50%;
margin-top:-125px;
background:#fff;
z-index:3;
left:50%;
margin-left:-130px;
font-size:15px;
color:#333;
font-weight:bold;
text-align:center;
}
.content img{
position:relative;top:10px;left:-8px;
}
</style>
</head>

本文介绍了一种使用JavaScript和CSS实现的网页加载动画效果。通过控制不同层的显示顺序和透明度,为用户提供了一个平滑的加载体验。文章详细展示了如何渐进地显示背景和提示信息,并提供了具体的代码实现。
1155

被折叠的 条评论
为什么被折叠?



