WEB编程开发常用的代码

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

WEB编程开发常用的代码--最小化、最大化、关闭窗口objectid=hh1classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11paramname=Commandvalue=Minimize/objectobjectid=hh2classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11paramname=Commandvalue=Maximize/objectOBJECTid=hh3classid=clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11PARAMNAME=Commandvalue=Close/OBJECTinputtype=buttonvalue=最小化onclick=hh1.Click()inputtype=buttonvalue=最大化onclick=hh2.Click()inputtype=buttonvalue=关闭onclick=hh3.Click()本例适用于IE记录并显示网页的最后修改时间scriptlanguage=JavaScriptdocument.write(最后更新时间:+document.lastModified+)/script2秒后关闭当前页scriptlanguage=JavaScript!--setTimeout('window.close();',2000);--/script2秒后载入指定网页headmetahttp-equiv=refreshcontent=2;URL=http://你的网址/head添加到收藏夹ScriptLanguage=JavaScriptfunctionbookmarkit(){window.external.addFavorite('http://你的网址','你的网站名称')}if(document.all)document.write('ahref=#onClick=bookmarkit()加入收藏夹/a')/Script禁止鼠标右键的动作ScriptLanguage=JavaScriptfunctionclick(){if(event.button==2||event.button==3){alert('禁止鼠标右键');}document.onmousedown=click//--/Script或scriptlanguage=JavaScriptfunctionclick(){if(event.button==2){alert('*^_^*');}}document.onmousedown=click//--/script设置该页为首页bodybgcolor=#FFFFFFtext=#000000aclass=chlnkstyle=cursor:handHREFonClick=this.style.behavior='url(#default#homepage)';this.setHomePage('你的网站名称);fontcolor=000000size=2face=宋体设为首页/font/a/body节日倒计时ScriptLanguage=JavaScriptvartimedate=newDate(October1,2002);vartimes=国庆节;varnow=newDate();vardate=timedate.getTime()-now.getTime();vartime=Math.floor(date/(1000*60*60*24));if(time=0)document.write(现在离+times+还有:+time+天)/Script单击按钮打印出当前页ScriptLanguage=JavaScriptif(window.print){document.write('form'+'inputtype=buttonname=printvalue=打印本页'+'onClick=javascript:window.print()/form');}/Script单击按钮‘另存为’当前页inputtype=buttonname=Buttonvalue=保存本页onClick=document.all.button.ExecWB(4,1)objectid=buttonwidth=0height=0classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2embedwidth=0height=0/embed/object显示系统当前日期scriptlanguage=JavaScripttoday=newDate();functiondate(){this.length=date.arguments.lengthfor(vari=0;ithis.length;i++)this[i+1]=date.arguments}vard=newdate(星期日,星期一,星期二,星期三,星期四,星期五,星期六);document.write(fontcolor=##000000style='font-size:9pt;font-family:宋体',today.getYear(),年,today.getMonth()+1,月,today.getDate(),日,d[today.getDay()+1],/font);/script不同时间段显示不同问候语ScriptLanguage=JavaScriptvartext=;day=newDate();time=day.getHours();if((time=0)&&(time7))text=夜猫子,要注意身体哦!if((time=7)&&(time12))text=今天的阳光真灿烂啊,你那个朋友呢?if((time=12)&&(time14))text=午休时间。您要保持睡眠哦!if((time=14)&&(time18))text=祝您下午工作愉快!if((time=18)&&(time=22))text=您又来了,可别和MM聊太久哦!if((time=22)&&(time24))text=您应该休息了!document.write(text)/Script水中倒影效果imgid=reflectsrc=你自己的图片文件名width=175height=59scriptlanguage=JavaScriptfunctionf1(){setInterval(mdiv.filters.wave.phase+=10,100);}if(document.all){document.write('imgid=mdivsrc='+document.all.reflect.src+'style=filter:wave(strength=3,freq=3,phase=0,lightstrength=30)blur()flipv()')window.onload=f1}/script慢慢变大的窗口ScriptLanguage=JavaScript!--varWindowsheight=100varWindowswidth=100varnumx=5functionopenwindow(thelocation){temploc=thelocation&,amp;,nbsp;if(!(window.resizeTo&&document.all)&&!(window.resizeTo&&document.getElementById)){window.open(thelocation)return}windowsize=window.open(,,scrollbars)windowsize.moveTo(0,0)windowsize.resizeTo(100,100)tenumxt()}functiontenumxt(){if(Windowsheight=screen.availHeight-3)numx=0windowsize.resizeBy(5,numx)Windowsheight+=5Windowswidth+=5if(Windowswidth=screen.width-5){windowsize.location=templocWindowsheight=100Windowswidth=100numx=5return}setTimeout(tenumxt(),50)}//--/scriptahref=javascript:openwindow(')进入/a鼠标指向时弹出信息框在body/body之间加上如下代码:ahrefonmouseover=alert('弹出信息!')显示的链接文字/a随机变换背景图象(一个可以刷新心情的特效)在head/head之间加上如下代码:ScriptLanguage=JavaScriptimage=newArray(4);//定义image为图片数量的数组image[0]='tu0.gif'//背景图象的路径image[1]='tu1.gif'image[2]='tu2.gif'image[3]='tu3.gif'image[4]='tu4.gif'number=Math.floor(Math.random()*image.length);document.write(BODYBACKGROUND=+image[number]+);/Script鼠标一碰就给颜色看的链接在body/body之间加上如下代码:ponMouseMove=anniu()你敢碰我,我就给点颜色你看!/pScriptLanguage=VBScriptsubanniudocument.fgColor=int(256*256*256*rnd)endsub/Script从天而降并有幻影效果的窗口headScriptlanguage=JavaScriptfunctionmove(x){if(self.moveBy){self.moveBy(0,-800);for(i=x;i0;i--){self.moveBy(0,3);}for(j=200;j0;j--){//如果你认为窗口抖动厉害,就200换成个位数self.moveBy(0,j);self.moveBy(j,0);self.moveBy(0,-j);self.moveBy(-j,0);}}}/ScripbodybgColor=#ffffffonload=move(280)/body/head表格的半透明显示效果在head/head之间加上如下代码:style.alpha{filter:Alpha(Opacity=50)}//50表示50%的透明度/style在body/body之间加上如下代码:tableborder=1width=100height=62class=alphabgcolor=#F2A664trtdwidth=100%height=62divalign=center很酷吧!/div/td/tr/table锁定状态栏文字防止显示地址bodyonmouseover=self.status='文字';returntrue禁止图片下载在body......这里的最后加入:oncontextmenu=returnfalseondragstart=returnfalseonselectstart=returnfalses

1 / 35
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功