特效网页代码整合.docx
- 文档编号:10035296
- 上传时间:2023-05-23
- 格式:DOCX
- 页数:69
- 大小:34.31KB
特效网页代码整合.docx
《特效网页代码整合.docx》由会员分享,可在线阅读,更多相关《特效网页代码整合.docx(69页珍藏版)》请在冰点文库上搜索。
特效网页代码整合
1.加入收藏夹代码
hand"onClick="window.external.addFavorite('','白兰地天文物理')"title="白兰地天文物理">收藏本站 2.设为首页代码 hand">设为首页 3.禁止使用鼠标 彻底屏蔽鼠标右键: oncontextmenu="window.event.returnValue=false" 禁用鼠标左键: functionclick(){ if(event.button==1){ alert('对不起,禁止使用此功能.') } } document.onmousedown=click 4.取消选取、防止复制 或: 不准粘贴: onpaste="returnfalse" 防止复制: oncopy="returnfalse;"oncut="returnfalse;" 5.IE地址栏前换成自己的图标 6.可以在收藏夹中显示出你的图标 7.关闭输入法 disabled"> 8.永远都会带着框架 -- if(window==top)top.location.href="frames.htm";//frames.htm为框架网页 //--> 9.防止被人frame -- if(top.location! =self.location)top.location=self.location; //--> 10.网页将不能被另存为 11. onclick="window.location="view-source: "+" 12.删除时确认 if(confirm("确实要删除吗? "))location="boos.asp? &areyou=删除&page=1"">删除 13.取得控件的绝对位置 //javascript functiongetIE(e){ vart=e.offsetTop; varl=e.offsetLeft; while(e=e.offsetParent){ t+=e.offsetTop; l+=e.offsetLeft; } alert("top="+t+"/nleft="+l); } //VBScript -- functiongetIE() dimt,l,a,b seta=document.all.img1 t=document.all.img1.offsetTop l=document.all.img1.offsetLeft whilea.tagName<>"BODY" seta=a.offsetParent t=t+a.offsetTop l=l+a.offsetLeft wend msgbox"top="&t&chr(13)&"left="&l,64,"得到控件的位置" endfunction --> 14.光标是停在文本框文字的最后 functioncc() { vare=event.srcElement; varr=e.createTextRange(); r.moveStart("character",e.value.length); r.collapse(true); r.select(); } 15.判断上一页的来源 javascript: document.referrer 16.最小化、最大化、关闭窗口 ADB880A6-D8FF-11CF-9377-00AA003B7A11"> ADB880A6-D8FF-11CF-9377-00AA003B7A11"> adb880a6-d8ff-11cf-9377-00aa003b7a11"> 本例适用于IE 各种用途的按钮大集合: '+window.location.href"> -- functionReloadButton(){location.href="3.html";} //--> -- functionHomeButton(){location.href="";} //--> -- functionAlertButton(){window.alert("今天你喝了没有? : )");} //--> -- functionStatusButton(){window.status="你好吗? : )";} //--> -- functionBgButton(){ if(document.bgColor=='#3399ff') {document.bgColor='#00ccff';} else{document.bgColor='#3399ff';} } //--> -- functionNewWindow(){window.open("","","height=600,width=800,left=10,top=10,status=no,location=no,toolbar=no,directories=no,menubar=no");} //--> 17.屏蔽功能键Shift,Alt,Ctrl functionlook(){ if(event.shiftKey) alert("禁止按Shift键! ");//可以换成ALTCTRL } document.onkeydown=look; 18.网页不会被缓存 21: 57GMT"> 或者 19.让表单没有凹凸感 1solid#000000"> 或 none;border-right: none;border-top: none;border-bottom: 1solid#000000"> 20. 用来定义同一行内的元素,跟 21.让弹出窗口总是在最上面: 22.不要滚动条 让竖条没有: scroll;overflow-y: hidden">no可用于Table