记得好像dreamweaver在以前的版本中可以制作移动的层,而且移动路径可以是任意的。在dreamweaver cs4怎样制作呢?(假设下面便是我要移动的层)
<div id="apDiv1"> <div align="center">welcome to my website(*^__^*)
</div>
</div>
用了marquee之后却不会移动啊。求指点。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>浮动层</title>
</head>
<body>
<div id="ad" style="position:absolute;width;700px;height:78px;background:url( http://mat1.gtimg.com/www/iskin960/s01/s_b_1.0.0.png);">
把你想要写的文字放在这里
</div>
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getElementById("ad")
function float() {
var L=T=0
var R= document.documentElement.clientWidth-obj.offsetWidth;
var B = document.documentElement.clientHeight-obj.offsetHeight;
obj.style.left = x + document.documentElement.scrollLeft+"px";
obj.style.top = y + document.documentElement.scrollTop+"px";
x = x + step*(xin?1:-1)
if (x < L) { xin = true; x = L}
if (x > R){ xin = false; x = R}
y = y + step*(yin?1:-1)
if (y < T) { yin = true; y = T }
if (y > B) { yin = false; y = B }
}
var itl= setInterval("float()", delay)
obj.onmouseover=function(){clearInterval(itl)}
obj.onmouseout=function(){itl=setInterval("float()", delay)}
</script>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<marquee direction="up" scrollamount="10" scrolldelay="200" >
<ul>
<li>正在滚动的层</li>
<li>正在滚动的层</li>
<li>正在滚动的层</li>
<li>正在滚动的层</li>
</ul>
</marquee>
</body>
</html>