许愿墙中用到的函数
许愿墙中用到的函数
发布时间:2016-12-30 来源:查字典编辑
摘要:复制代码代码如下://--控制层删除startofscript-->functionssdel(){if(event){lObj=event...

复制代码 代码如下:

<scriptlanguage="JavaScript1.2">

//--控制层删除startofscript-->

functionssdel(){

if(event)

{

lObj=event.srcElement;

while(lObj&&lObj.tagName!="DIV")lObj=lObj.parentElement;

}

varid=lObj.id

document.getElementById(id).removeNode(true);

//document.getElementById(id).outerHTML="";//

}

//--控制层删除Endofscript-->

</script>

<script>

//--控制层移动startofscript-->

varObj=''

varindex=10000;//z-index;

document.onmouseup=MUp

document.onmousemove=MMove

functionMDown(Object){

Obj=Object.id

document.all(Obj).setCapture()

pX=event.x-document.all(Obj).style.pixelLeft;

pY=event.y-document.all(Obj).style.pixelTop;

}

functionMMove(){

if(Obj!=''){

document.all(Obj).style.left=event.x-pX;

document.all(Obj).style.top=event.y-pY;

}

}

functionMUp(){

if(Obj!=''){

document.all(Obj).releaseCapture();

Obj='';

}

}

functionsetTagBPic(i){

picurl=getBPic(i);

getObj('tagBPic').style.background="transparenturl(""+picurl+"")no-repeatscrollbottomleft";

cf.tagbgpic.value=i;

}

functionsetTagBColor(i){

color=getBColor(i);

getObj('preview').style.background=''+color;

cf.tagbgcolor.value=i;

}

functiongetBPic(i){

i=(i<1||i>8)?1:i;

return"images/pic"+parseInt(parseInt(i)+27)+".gif";

}

//--控制层移动endofscript-->

//获得焦点;

functiongetFocus(obj)

{

if(obj.style.zIndex!=index)

{

index=index+2;

varidx=index;

obj.style.zIndex=idx;

//obj.nextSibling.style.zIndex=idx-1;

}

}

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新Javascript教程学习
热门Javascript教程学习
编程开发子分类