怎样制作网页中的浮动层效果?

来源:百度知道 编辑:UC知道 时间:2024/05/17 23:32:53
就是那种随滚动条移动的图片
代码就该怎么写,最好写上注释
还有一种外部调用:就是先用Js写好后,如何在网页中直接调用啊?

<!-- 完整的HTML代码如下 -->
1.首先在<head>和</head>之间插入下列代码
<br>
<style type="text/css">
#floater {
position: absolute;
left: 500;
top: 146;
width: 176;
visibility: visible;
z-index: 10;
}
-->
</style>
<br>

<br>
2.在body中的任意位置插入下列代码

<div ID="floater" style="left: 590px; top: 158px">
<p align="center">
<img src="http://cfan.net.cn/tutu/200406301.jpg" width="127" height="150"><br>
<font color="#FF8040">欢迎光临</font></p>
</div><script LANGUAGE="JavaScript">
self.onError=null;
currentX = currentY = 0;
whichIt = null;
lastScrollX = 0; lastScrollY = 0;
NS = (document.layers) ? 1