书签 分享 收藏 举报 版权申诉 / 17

类型js部分特效代码.docx

  • 文档编号:9003126
  • 上传时间:2023-02-02
  • 格式:DOCX
  • 页数:17
  • 大小:21.61KB

functionsc1(){

document.getElementById("Javascript.Div1").style.top=(document.documentElement.scrollTop+(document.documentElement.clientHeight-document.getElementById("Javascript.Div1").offsetHeight)/2)+"px";

document.getElementById("Javascript.Div1").style.left=(document.documentElement.scrollLeft+(document.documentElement.clientWidth-document.getElementById("Javascript.Div1").offsetWidth)/2)+"px";

}

240px;height:

90px"align="center">左上...

functionsc2(){

document.getElementById("Javascript.Div2").style.top=(document.documentElement.scrollTop)+"px";

document.getElementById("Javascript.Div2").style.left=(document.documentElement.scrollLeft)+"px";

}

240px;height:

90px"align="center">左下...

functionsc3(){

document.getElementById("Javascript.Div3").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("Javascript.Div3").offsetHeight)+"px";

document.getElementById("Javascript.Div3").style.left=(document.documentElement.scrollLeft)+"px";

}

240px;height:

90px"align="center">右上...

functionsc4(){

document.getElementById("Javascript.Div4").style.top=(document.documentElement.scrollTop)+"px";

document.getElementById("Javascript.Div4").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("Javascript.Div4").offsetWidth)+"px";

}

240px;height:

90px"align="center">右下...

functionsc5(){

document.getElementById("Javascript.Div5").style.top=(document.documentElement.scrollTop+document.documentElement.clientHeight-document.getElementById("Javascript.Div5").offsetHeight)+"px";

document.getElementById("Javascript.Div5").style.left=(document.documentElement.scrollLeft+document.documentElement.clientWidth-document.getElementById("Javascript.Div5").offsetWidth)+"px";

}

--

functionscall(){

sc1();sc2();sc3();sc4();sc5();

}

window.onscroll=scall;

window.onresize=scall;

window.onload=scall;

//-->

absolute;top:

0px;left:

0px;width:

10000px;height:

4000px;">

表格交替颜色

window.onload=function(){

doubleBgColor(document.getElementById("table1"),"#cecece","#ececec")

}

functiondoubleBgColor(Table,Bg1,Bg2){

for(vari=0;i

Bg2:

Bg1;

}

查找更多代码,请访问:

懒人图库

单击表格变换颜色

aa

aa

aa

查找更多代码,请访问:

懒人图库

动画效果打开层/关闭层

DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http:

//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

//www.w3.org/1999/xhtml">

DOM_text01

body,span,div,td{font-size:

12px;line-height:

1.5em;color:

#849BCA;}

#bodyL{

float:

left;

width:

84px;

margin-right:

2px;

}

a.od{

width:

80px;

height:

25px;

line-height:

25px;

text-align:

center;

font-weight:

bold;

border:

1pxsolid#849BCA;

display:

block;

color:

#547BC9;

float:

left;

text-decoration:

none;

margin-top:

2px;

}

a.od:

link{

background:

#EEF1F8;

}

a.od:

visited{

background:

#EEF1F8;

}

a.od:

hover{

background:

#EEE;

}

a.od:

active{

background:

#EEE;

}

#fd{

width:

500px;

height:

200px;

background:

#EDF1F8;

border:

1pxsolid#849BCA;

margin-top:

2px;

margin-left:

2px;

float:

left;

overflow:

hidden;

position:

absolute;

left:

0px;

top:

0px;

cursor:

move;

float:

left;

/*filter:

alpha(opacity=50);*/

}

.content{

padding:

10px;

}

[打开层]

[关闭层]

none;filter:

alpha(opacity=100);opacity:

1;">

移动层

varprox;

varproy;

varproxc;

varproyc;

functionshow(id){/*--打开--*/

clearInterval(prox);

clearInterval(proy);

clearInterval(proxc);

clearInterval(proyc);

varo=document.getElementById(id);

o.style.display="block";

o.style.width="1px";

o.style.height="1px";

prox=setInterval(function(){openx(o,500)},10);

}

functionopenx(o,x){/*--打开x--*/

varcx=parseInt(o.style.width);

if(cx

{

o.style.width=(cx+Math.ceil((x-cx)/5))+"px";

}

else

{

clearInterval(prox);

proy=setInterval(function(){openy(o,200)},10);

}

}

functionopeny(o,y){/*--打开y--*/

varcy=parseInt(o.style.height);

if(cy

{

o.style.height=(cy+Math.ceil((y-cy)/5))+"px";

}

else

{

clearInterval(proy);

}

}

functioncloseed(id){/*--关闭--*/

clearInterval(prox);

clearInterval(proy);

clearInterval(proxc);

clearInterval(proyc);

varo=document.getElementById(id);

if(o.style.display=="block")

{

proyc=setInterval(function(){closey(o)},10);

}

}

functionclosey(o){/*--打开y--*/

varcy=parseInt(o.style.height);

if(cy>0)

{

o.style.height=(cy-Math.ceil(cy/5))+"px";

}

else

{

clearInterval(proyc);

proxc=setInterval(function(){closex(o)},10);

}

}

functionclosex(o){/*--打开x--*/

varcx=parseInt(o.style.width);

if(cx>0)

{

o.style.width=(cx-Math.ceil(cx/5))+"px";

}

else

{

clearInterval(proxc);

o.style.display="none";

}

}

/*-------------------------鼠标拖动---------------------*/

varod=document.getElementById("fd");

vardx,dy,mx,my,mouseD;

varodrag;

varisIE=document.all?

true:

false;

document.onmousedown=function(e){

vare=e?

e:

event;

if(e.button==(document.all?

1:

0))

{

mouseD=true;

}

}

document.onmouseup=function(){

mouseD=false;

odrag="";

if(isIE)

{

od.releaseCapture();

od.filters.alpha.opacity=100;

}

else

{

window.releaseEvents(od.MOUSEMOVE);

od.style.opacity=1;

}

}

//functionreadyMove(e){

od.onmousedown=function(e){

odrag=this;

vare=e?

e:

event;

if(e.button==(document.all?

1:

0))

{

mx=e.clientX;

my=e.clientY;

od.style.left=od.offsetLeft+"px";

od.style.top=od.offsetTop+"px";

if(isIE)

{

od.setCapture();

od.filters.alpha.opacity=50;

}

else

{

window.captureEvents(Event.MOUSEMOVE);

od.style.opacity=0.5;

}

//alert(mx);

//alert(my);

}

}

document.onmousemove=function(e){

vare=e?

e:

event;

//alert(mrx);

//alert(e.button);

if(mouseD==true&&odrag)

{

varmrx=e.clientX-mx;

varmry=e.clientY-my;

od.style.left=parseInt(od.style.left)+mrx+"px";

od.style.top=parseInt(od.style.top)+mry+"px";

mx=e.clientX;

my=e.clientY;

}

}



更多代码请访问懒人图库

响应鼠标变换表格背景或者颜色

响应鼠标变换表格背景图片:

this.background='onmouseout=background='images/lanrentuku-2.jpg'>

鼠标移上来看看,再移走看看~

或者如下所写,这个是变化背景颜色:

鼠标移上来看看,再移走看看~

查找更多代码,请访问:

懒人图库

泪流满面的404页面

DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http:

//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

//www.w3.org/1999/xhtml">

您找的页面不存在

--

BODY{PADDING-RIGHT:

0px;PADDING-LEFT:

35px;BACKGROUND:

url(/images/photoback.gif)repeat-xlefttop;PADDING-BOTTOM:

0px;MARGIN:

0px;FONT:

12pxArial,Helvetica,sans-serif;COLOR:

#333;PADDING-TOP:

35px}

A{COLOR:

#007ab7;TEXT-DECORATION:

none}

A:

hover{COLOR:

#007ab7;TEXT-DECORATION:

none}

A:

hover{COLOR:

#de1d6a}

.hidehr{DISPLAY:

none}

.show12{PADDING-RIGHT:

0px;DISPLAY:

block;PADDING-LEFT:

0px;PADDING-BOTTOM:

0px;MARGIN:

5px0px;PADDING-TOP:

0px}

举报
举报
版权申诉
版权申诉
word格式文档无特别注明外均可编辑修改;预览文档经过压缩,下载后原文更清晰! 立即下载
配套讲稿:

如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。

特殊限制:

部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。

关 键  词:
js 部分 特效代码
提示  冰豆网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:js部分特效代码.docx
链接地址:https://www.bdocx.com/doc/9003126.html
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2008-2022 冰点文档网站版权所有

经营许可证编号:鄂ICP备2022015515号-1

收起
展开