在网页上写两以上的个脚本,可是运行的时候只有一个才可以,那里出了问题,请高人指点
当写两个以上的脚本的时候,运行的时候只能出现一个效果,是那里出现了问题,感激不尽...<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script>
var tips;
var theTop = 10; /*这是默认高度,越大越往下*/
var old = theTop;
function moveTips() {
var tt = 0;
if (window.innerHeight) {
pos = window.pageYOffset
} else if (document.documentElement && document.documentElement.scrollTop) {
pos = document.documentElement.scrollTop
} else if (document.body) {
pos = document.body.scrollTop;
}
pos = pos - tips.offsetTop + theTop;
pos=tips.offsetTop+pos/10;
if (pos < theTop) pos = theTop;
if (pos != old) {
tips.style.top = pos+"px";
tt = 0;
}
old = pos;
setTimeout(moveTips,tt);
}
onload = function initFloatTips() {
tips = document.getElementById('left');
moveTips();
};
</script>
<script>
var xjp;
var theTop1 = 10; /*这是默认高度,越大越往下*/
var old1 = theTop1;
function movexjp() {
var tt1 = 0;
if (window.innerHeight) {
pos1 = window.pageYOffset
} else if (document.documentElement && document.documentElement.scrollTop) {
pos1 = document.documentElement.scrollTop
} else if (document.body) {
pos1 = document.body.scrollTop;
}
pos1 = pos1 - xjp.offsetTop + theTop1;
pos1=xjp.offsetTop+pos1/10;
if (pos1 < theTop1) pos1 = theTop1;
if (pos1 != old1) {
xjp.style.top = pos1+"px";
tt1 = 0;
}
old1 = pos1;
setTimeout(movexjp,tt1);
}
onload = function initFloatxjp() {
xjp = document.getElementById('weight');
movexjp();
};
</script>
<style type="text/css">
<!--
.Layer1 {
position:absolute;
left:30px;
top:19px;
width:102px;
height:789px;
z-index:1;
}
.Layer2 {
position:absolute;
left:1118px;
top:11px;
width:104px;
height:800px;
z-index:2;
}
-->
</style>
</head>
<body>
<div id="left" class="Layer1">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,19,0" width="89" height="781">
<param name="movie" value="励志照亮人生.swf" />
<param name="quality" value="high" />
<embed src="励志照亮人生.swf" quality="high" pluginspage="http://www. type="application/x-shockwave-flash" width="89" height="781"></embed>
</object>
</div>
<div id="weight" class="Layer2">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,19,0" width="97" height="787">
<param name="movie" value="编程改变命运.swf" />
<param name="quality" value="high" />
<embed src="编程改变命运.swf" quality="high" pluginspage="http://www. type="application/x-shockwave-flash" width="97" height="787"></embed>
</object>
</div>
</body>
</html>