当前位置: 首页 > 图文教程 > 网络编程 > Javascript > 许愿墙中用到的函数

Javascript
学习js所必须要知道的一些
动态生成页面元素的代码
js+FSO遍历文件夹下文件并显示
动态控制Table的js代码
javascript中的location用法简单介绍
用window.location.href实现刷新另个框架页面
从JavaScript的函数重名看其初始化方式
利用JScript中运算符"||"和"&&"的特殊特性实现代码精简
JScript中的''var''定义变量的作用域
JavaScript语言中的Literal Syntax特性分析
JS类中定义原型方法的两种实现的区别
在JavaScript中使用inline函数的问题
区分JS中的undefined,null,"",0和false
JavaScript中this关键字使用方法详解
function, new function, new Function之间的区别
JScript中的"this"关键字使用方式补充材料
JavaScript语句可以不以;结尾的烦恼
JScript中的undefined和"undefined"的区别
使用IE的地址栏来辅助调试Web页脚本
JS类库Bindows1.3中的内存释放方式分析

Javascript 中的 许愿墙中用到的函数


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-12   浏览: 166 ::
收藏到网摘: n/a

复制代码 代码如下:

<script language="JavaScript1.2">
//-- 控制层删除start of script -->
function ssdel(){
if (event)
{
lObj = event.srcElement ;
while (lObj && lObj.tagName != "DIV") lObj = lObj.parentElement ;
}
var id=lObj.id
document.getElementById(id).removeNode(true);
//document.getElementById(id).outerHTML="";//
}
//-- 控制层删除End of script -->
</script>
<script>
//-- 控制层移动start of script -->
var Obj=''
var index=10000;//z-index;
document.onmouseup=MUp
document.onmousemove=MMove
function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}
function MMove(){
if(Obj!=''){
document.all(Obj).style.left=event.x-pX;
document.all(Obj).style.top=event.y-pY;
}
}
function MUp(){
if(Obj!=''){
document.all(Obj).releaseCapture();
Obj='';
}
}
function setTagBPic(i) {
picurl = getBPic(i);
getObj('tagBPic').style.background = " transparent url(\"" + picurl + "\") no-repeat scroll bottom left";
cf.tagbgpic.value = i;
}
function setTagBColor(i) {
color = getBColor(i);
getObj('preview').style.background = '' + color;
cf.tagbgcolor.value = i;
}

function getBPic(i) {
i = (i<1 || i>8)?1:i;
return "images/pic" + parseInt(parseInt(i)+27) +".gif";
}
//-- 控制层移动end of script -->
//获得焦点;
function getFocus(obj)
{
if(obj.style.zIndex!=index)
{
index = index + 2;
var idx = index;
obj.style.zIndex=idx;
//obj.nextSibling.style.zIndex=idx-1;
}
}