随滚动条移动的DIV层(正中、左上、…

原创 2016年06月02日 12:48:45

<!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>
<TITLE>随滚动条移动的层 - www.chinaz.com</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html" charset="gb2312">
<META NAME="Author" CONTENT="haiwa">
<META NAME="homepage" CONTENT="www.chinaz.com">
</HEAD>
<style>
<!--
.div{
 position: absolute;
 border: 2px solid red;
 background-color: #EFEFEF;
 line-height:90px;
 font-size:12px;
 z-index:1000;
}
-->
</style>
<BODY>
<div id="Javascript.Div1" class="div" style="width: 240px; height:90px" align="center">正中...</div>
<SCRIPT LANGUAGE="JavaScript">
function sc1(){
 document.getElementByIdx("Javascript.Div1").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementByIdx("Javascript.Div1").offsetHeight)/2)+"px";
 document.getElementByIdx("Javascript.Div1").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementByIdx("Javascript.Div1").offsetWidth)/2)+"px";
}
</SCRIPT>


<div id="Javascript.Div2" class="div" style="width: 240px; height:90px" align="center">左上...</div>
<SCRIPT LANGUAGE="JavaScript">
function sc2(){
 document.getElementByIdx("Javascript.Div2").style.top=(document.documentElement.scrollTop)+"px";
 document.getElementByIdx("Javascript.Div2").style.left=(document.documentElement.scrollLeft)+"px";
}
</SCRIPT>

<div id="Javascript.Div3" class="div" style="width: 240px; height:90px" align="center">左下...</div>
<SCRIPT LANGUAGE="JavaScript">
function sc3(){
 document.getElementByIdx("Javascript.Div3").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementByIdx("Javascript.Div3").offsetHeight)+"px";
 document.getElementByIdx("Javascript.Div3").style.left=(document.documentElement.scrollLeft)+"px";
}
</SCRIPT>

<div id="Javascript.Div4" class="div" style="width: 240px; height:90px" align="center">右上...</div>
<SCRIPT LANGUAGE="JavaScript">
function sc4(){
 document.getElementByIdx("Javascript.Div4").style.top=(document.documentElement.scrollTop)+"px";
 document.getElementByIdx("Javascript.Div4").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementByIdx("Javascript.Div4").offsetWidth)+"px";
}
</SCRIPT>

<div id="Javascript.Div5" class="div" style="width: 240px; height:90px" align="center">右下...</div>
<SCRIPT LANGUAGE="JavaScript">
function sc5(){
 document.getElementByIdx("Javascript.Div5").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementByIdx("Javascript.Div5").offsetHeight)+"px";
 document.getElementByIdx("Javascript.Div5").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementByIdx("Javascript.Div5").offsetWidth)+"px";
}
</SCRIPT>


<SCRIPT LANGUAGE="JavaScript">
<!--
function scall(){
 sc1();sc2();sc3();sc4();sc5();
}
window.onscroll=scall;
window.onresize=scall;
window.onload=scall;
//-->
</SCRIPT>
<div style="position: absolute; top: 0px; left: 0px; width: 10000px; height: 4000px;"></div>
</BODY>
</HTML>

 

 

http://edu.1uon.com/Article/Design/Javascript/2062.html

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

随滚动条移动的DIV层

随滚动条移动的DIV层 .div { position: absolute; border: 2px...

CSS基础 不会随着滚动条变化的固定在左上角的div块

镇场诗:慈心积善融学习,技术誓为大家学。善心速造多好事,前人栽树后乘凉。我今于此写经验,愿见文者得启发。 ———————————————————————————————————————————————...

div浮层,滚动条移动,保持位置不变的4种方法

div在顶部不变、滚动条滚动,div还是在顶部! 直接上传源码 了: 方法一: [html] view plaincopyprint? >      html x...

随 滚动条 移动 的 层

  • 2010-02-03 09:35
  • 1020B
  • 下载

层随滚动条移动

随滚动条移动的层

随滚动条移动的层 - 51windows.Net <!-- .div{ position: absolute; border: 2px solid red; background-co...

js 实现层随滚动条移动效果

随滚动条移动的层 - 51windows.Net .div{  position: absolute;  border: 2px solid red;  backgro...

DIV层 随滚动条一起滚动

function scrollImg() { var posX, posY; if (window.innerHeight) { ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)