初学者提问 这个问题不麻烦吧? 怎么没人回答呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是麻不麻烦的事。而是你说的不够明白。 我是用javascirpt写的<script>var 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 startit() {img.visibility = "visible";interval = setInterval('changePos()', delay);}function stopit() { clearInterval(interval);}startit();</script> <div id="img" style="position: absolute; left: 0; top: 1652; width: 137; height: 106"> <div id="leftup" style="position:relative; z-index:1; width: 80; height: 60"> <img src="images/piao1.gif" border=0 width="100" height="100"></div></div>我是判断在不同情况下让这幅图片漂浮出来,现在允许它漂浮的时候一切正常,可不允许它出来的时候就报错,错误为:出现运行期错误,错误img未定义。还请各位帮忙! 居然没人帮我, 无奈!! Ext如何动态修改HTML数据的操作方法??? 对于这页的BUTTON是如何控制按下后不可再按 单选按钮为什么不能选? 请问~~~ javascript有没有表单清空的函数?reset() 请问这段javascript代码该如何写,请高手一定要帮忙啊! 请教一个麻烦的窗口关闭问题?!!! 通过一个可见按钮触发一个input file控件的问题,高手请进。 不知道能不能搞定这个问题?有没有更简单的方法? 一个关于NaN的问题 在用DOM方法,修改、增加、删除文件节点后,如何保存问题? 请问如何用javascript调用web服务?在线等,马上给分
<script>
var 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 startit() {
img.visibility = "visible";
interval = setInterval('changePos()', delay);
}function stopit() {
clearInterval(interval);
}
startit();
</script> <div id="img" style="position: absolute; left: 0; top: 1652; width: 137; height: 106">
<div id="leftup" style="position:relative; z-index:1; width: 80; height: 60">
<img src="images/piao1.gif"
border=0 width="100" height="100"></div></div>
我是判断在不同情况下让这幅图片漂浮出来,现在允许它漂浮的时候一切正常,可不允许它出来的时候就报错,错误为:出现运行期错误,错误img未定义。还请各位帮忙!