网页制作如何加入浮动窗口? 请问如何在网页中用代码加入浮动窗口 啊?我用的是Dreamweaver 8 做的网页!感谢啦! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><title>浮动广告</title></head><body><div id="img" style="position:absolute; left:35px; top:556px; "><img src="http://c.csdn.net/bbs/t/5/i/pic_logo.gif" ></img></div><SCRIPT LANGUAGE="JavaScript"><!-- Beginvar xPos = 20;var yPos = document.body.clientHeight;var step = 1;var delay = 30;var height = 0;var Hoffset = 0;var Woffset = 0;var yon = 0;var xon = 0;var pause = true;var interval;img.style.top = yPos;function changePos() {width = document.body.clientWidth;height = document.body.clientHeight;Hoffset = img.offsetHeight;Woffset = img.offsetWidth;img.style.left = xPos + document.body.scrollLeft;img.style.top = yPos + document.body.scrollTop;if (yon) {yPos = yPos + step;}else {yPos = yPos - step;}if (yPos < 0) {yon = 1;yPos = 0;}if (yPos >= (height - Hoffset)) {yon = 0;yPos = (height - Hoffset);}if (xon) {xPos = xPos + step;}else {xPos = xPos - step;}if (xPos < 0) {xon = 1;xPos = 0;}if (xPos >= (width - Woffset)) {xon = 0;xPos = (width - Woffset);}}function start() {img.visibility = "visible";interval = setInterval('changePos()', delay);}start();// End --></script></body></html> 其实最好的是理解他的实现原理,工具也不过是一些封装好的方法而已,浮动元素是一个块元素,设置它的属性为float并且可以指定他的位置和层叠优先级。 自定义DateAdd函数,参数值莫名改变 文本框,readonly,其值改变后,能触发什么事件? 晕了 自己ajax的一个页面 里面的<script>中的里面有"字符串" 导致无法执行 请问怎么办? 怎么又循环了一次!!!!!!! 问一下正则 怎么实现登录成功后返回到我正在浏览的页面 [强烈推荐]求 <JavaScript高级程序设计>(中文)PDF 要全的[推荐] 谁能帮我下面一个javascript实例每句解释说明一下!!! 请问javascript+asp如何解决字幕滚动效果? 百分求救:如何在onClick事件里面更改Session js函数修改全局变量 求一段简单的JS代码
<html>
<head>
<title>浮动广告</title>
</head>
<body>
<div id="img" style="position:absolute; left:35px; top:556px; "><img src="http://c.csdn.net/bbs/t/5/i/pic_logo.gif" ></img></div><SCRIPT LANGUAGE="JavaScript"><!-- Beginvar xPos = 20;var yPos = document.body.clientHeight;var step = 1;var delay = 30;var height = 0;var Hoffset = 0;var Woffset = 0;var yon = 0;var xon = 0;var pause = true;var interval;img.style.top = yPos;function changePos() {width = document.body.clientWidth;height = document.body.clientHeight;Hoffset = img.offsetHeight;Woffset = img.offsetWidth;img.style.left = xPos + document.body.scrollLeft;img.style.top = yPos + document.body.scrollTop;if (yon) {yPos = yPos + step;}else {yPos = yPos - step;}if (yPos < 0) {yon = 1;yPos = 0;}if (yPos >= (height - Hoffset)) {yon = 0;yPos = (height - Hoffset);}if (xon) {xPos = xPos + step;}else {xPos = xPos - step;}if (xPos < 0) {xon = 1;xPos = 0;}if (xPos >= (width - Woffset)) {xon = 0;xPos = (width - Woffset);}}function start() {img.visibility = "visible";interval = setInterval('changePos()', delay);}start();// End --></script>
</body>
</html>