脚本之家 层模拟小窗口效果代码 " + "" + "" + this.title + "" + "0" + "r" + "" + "" + this.message + "" + "" + ""; document.body.insertAdjacentHTML("beforeEnd",str); } //显示隐藏窗口 function ShowHide(id,dis){ var bdisplay = (dis==null)?((document.getElementById("xMsg"+id).style.display=="")?"none":""):dis document.getElementById("xMsg"+id).style.display = bdisplay; document.getElemen...
脚本之家---模拟弹出提示 脚本之家 var cao_x,cao_y; function cao888() { this.display=display; } function display() { document.write("脚本之家留言"); document.write(""); document.write(""); document.write(""); document.write(""); document.write("脚本之家"); document.write(""); document.write(""); document.write("欢迎光临脚本之家[确定]"); document.write(" "); document.write("...
// ************************ 拖动 ********************************* function setDrag(e){ var drag_flag = true; var begin_x = getX(e); //添加蒙板 createMask(); //添加半透明拖动条 createSplitDiv(); function getX(e){ if(window.event) e = window.event; return (e.x || e.clientX); } fu...
振动 function zd(u){ var a=['top','left'],b=0; u=setInterval(function(){ document.getElementById('win').style[a[b%2]]=(b++)%415){clearInterval(u);b=0} },32) } 欢迎访问脚本之家,www.gxlcms.com [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
使用该程序能实现很多常见的动画特效,包括大小变换、位置变换、渐显渐隐等等。 程序说明: 渐变效果的原理就是利用定时器不断设置值,如果要减速效果就设置一个步长(详细看JavaScript 弹簧效果) 。 这里只是把能渐变的属性(透明度、宽、高、left、top)整合在一起,使用相同的渐变级数(Step)使渐变同步,形成多个属性同时渐变的效果。 下面说说有用的地方: 【最终样式】 在JavaScript 图片切割效果的边宽获取中也说到了最终...
js小鱼吐泡泡在页面游动 = Pics.length) Pos=0; if (Ns) document.nfish.document.images.nframe.src=Pics[Pos]; else document.images.iframe.src=Pics[Pos]; Timer=setTimeout('AniFish()',50) } function MoveFish(){ H=(document.layers)?window.innerHeight+window.pageYOffset:window.document.body.clientHeight+document.body.scrollTop; W=(document.layers)?window.innerWidth+window.pageXOffset:window.document.bo...
仿3721首页模块拖曳移动效果[拖曳层移动层]呵,做了一些细致的处理 html, body { width:100%; height:100%; padding:0px; margin:0px; } body { text-align:center; font-size:14px; } .cell_left, .cell_right { width:202px; } .cell_center { width:404px; } .left { float:left; } .row { clear:both; } .r_nbsp { width:20px; } .root { width:876px; height:auto; margin:auto; } .root * { /*此属性FF的说*/ -mo...
星空效果_www.gxlcms.com ABCD [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
没什么好说的,都是js,用一个iframe将页面遮挡,iframe上面一个div层,js面向对象做的,其中有部分是js动态生成style。ModeWindow.js 代码如下: Untitled Page var myWin; function show1(){ var divtest = document.getElementById("divtest"); divtest.style.display="block"; myWin = new ModeWindow(divtest,200,300,300,100,"i change!"); myWin.show(); } function show2(){ var tbtest = document.getElementById("tbte...
后来发现,如果div样式,如果设置了具体的高度,无论ie还ff,都能正常的表现。 但这个高度并不是固定的,而是会随着旁边div内容的多少而变化。最后,只好借助javascript,加载时捕获有关的div的高度,将其赋值给指定的div样式,终于看到了想要的东西。 具体脚本是这样的: window.onload=function(){ document.getElementById('bg').style.height=document.getElementById('mydiv').offsetHeight+'px'; } “bg”是要更改高度的div,...
DW调色板 var ColorHex=new Array('00','33','66','99','CC','FF') var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF') var current=null function intocolor() { var colorTable='' for (i=0;i' colorTable=colorTable+'' if (i==0){ colorTable=colorTable+''} else{ colorTable=colorTable+''} colorTable=colorTable+'' for (k=0;k' } } } } colorTable='' +'' +'' +'' +''...
代码如下: 颜色选择器 body{ text-align:center; } var ColorHex=new Array('00','33','66','99','CC','FF') var SpColorHex=new Array('FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF') var current=null function initcolor(evt) { var colorTable='' for (i=0;i{ for (j=0;j{ colorTable=colorTable+'' colorTable=colorTable+'' if (i==0){ colorTable=colorTable+''} else{ colorTable=colorTable+''} c...
代码如下:backgroundRepeat = "no-repeat"
js页面模块自由拖动 .removableObj { height:25;position:relative; } var beginMoving=false; var sourceObj=null; var objectObj=null; function MouseDownToMove(obj){ obj.style.zIndex=1; obj.mouseDownY=event.clientY; obj.mouseDownX=event.clientX; beginMoving=true; obj.setCapture(); sourceObj=obj; objectObj=null; } function MouseMoveToMove(obj){ if(!beginMoving) return false; obj.style.to...
scroll 控制台 控制台输出。。。 控制台输出。。。 控制台输出。。。 控制台输出。。。 控制台输出。。。 function test(){ var vs = document.getElementById("dd").innerHTML; document.getElementById("dd").innerHTML = vs +"控制台输出。。。"; document.getElementById("dd").scrollTop=1000000; } [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]