求助:图片上下随页面浮动 我要在页面两侧加上两个图片随网页上下浮动,要怎么实现?急 啊 !!求助各位高人!!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <script>var obj1=null;var obj2=null;var ts;window.onload=Init;function Init(){ obj1=document.getElementById("div1"); obj2=document.getElementById("div2"); obj1.style.left=parseInt(document.body.clientWidth)-parseInt(obj1.offsetWidth)+"px";//居右 obj1.style.top=0; obj2.style.left=0; obj2.style.top=0; ts=setInterval(CheckPos,10); //控制位置函数}function CheckPos(){ obj1.style.top=document.body.scrollTop+"px"; obj2.style.top=document.body.scrollTop+"px";}</script><body><div id="div1" style="position:absolute;"> <img src="caribi.gif"/> </div><div id="div2" style="position:absolute;"> <img src="caribi.gif"/> </div><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>侧边广告</title><script language="javascript">//设定相对位置imgleft=170;imgHeight=250;//图片移动函数function imgmove(){mylayer.style.top=document.body.scrollTop+document.body.offsetHeight-imgHeight;mylayer.style.left=document.body.offsetWidth-imgleft;mylayer1.style.top=document.body.scrollTop+document.body.offsetHeight-imgHeight;mylayer1.style.right=document.body.offsetWidth-imgleft;setTimeout("imgmove()",80);}</script></head><body onLoad="imgmove()"><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><h1> </h1><center><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www</center><div id="mylayer" style="position:absolute;width:64;top:300;hidden:visible;z-index:1; margin-left:20px;"><img src="http://www.phpfans.net/bbs/customavatars/2.jpg" width="100" height="120"></div><div id="mylayer1" style="position:absolute;width:64;top:300;hidden:visible;z-index:1; margin-right:20px"><img src="http://www.phpfans.net/bbs/customavatars/2.jpg" width="100" height="120"></div></body></html> 多参考Dom手册www.w3school.com.cn delete在IE失效,求解 |zyciis| Jquery 如何查询出当前网页中的所有class="a1"和class="a2"的对像,谢谢 如何从后台页面控制一个前台的js树形菜单项的添加和删除 JS外函数调用另一个函数成员变量 急 打开窗口 如何判断文本框内的值只是中文,其中不包含数字符号字母等 优众网首页效果 js的效率问题 怎么通过js控制,点击表格后设置 tr 的背景色? bootstrap的模态框问题 有没有大神帮忙看看~ 导出EXCEL出现了两个错误 163右上角翻页关闭代码演示
var obj1=null;
var obj2=null;
var ts;
window.onload=Init;
function Init()
{
obj1=document.getElementById("div1");
obj2=document.getElementById("div2");
obj1.style.left=parseInt(document.body.clientWidth)-parseInt(obj1.offsetWidth)+"px";//居右
obj1.style.top=0;
obj2.style.left=0;
obj2.style.top=0;
ts=setInterval(CheckPos,10); //控制位置函数
}
function CheckPos()
{
obj1.style.top=document.body.scrollTop+"px";
obj2.style.top=document.body.scrollTop+"px";
}
</script>
<body>
<div id="div1" style="position:absolute;">
<img src="caribi.gif"/> </div>
<div id="div2" style="position:absolute;">
<img src="caribi.gif"/> </div>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>侧边广告</title>
<script language="javascript">
//设定相对位置
imgleft=170;
imgHeight=250;
//图片移动函数
function imgmove(){
mylayer.style.top=document.body.scrollTop+document.body.offsetHeight-imgHeight;
mylayer.style.left=document.body.offsetWidth-imgleft;
mylayer1.style.top=document.body.scrollTop+document.body.offsetHeight-imgHeight;
mylayer1.style.right=document.body.offsetWidth-imgleft;
setTimeout("imgmove()",80);
}
</script>
</head>
<body onLoad="imgmove()">
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1>
<h1> </h1><center>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>www</center>
<div id="mylayer" style="position:absolute;width:64;top:300;hidden:visible;z-index:1; margin-left:20px;"><img src="http://www.phpfans.net/bbs/customavatars/2.jpg" width="100" height="120"></div>
<div id="mylayer1" style="position:absolute;width:64;top:300;hidden:visible;z-index:1; margin-right:20px"><img src="http://www.phpfans.net/bbs/customavatars/2.jpg" width="100" height="120"></div>
</body>
</html>
www.w3school.com.cn