|
| 网页特效<四>鼠标特效 |
|
|
|
|
来源:CF66.net 作者: 阅读: 次 字体:大 中 小 |
|
|
|
1.屏蔽鼠标左、右键
修改<body>标签,加入 oncontextMenu="return false" onselectStart="return false"
2.右键自动重定向
说明 禁止使用鼠标右键,如果你点了右键页面就自动跳转到相应链接上 代码 <script language="JavaScript">
url="http://www.cf66.net";
if (navigator.appName.indexOf ("Internet Explorer") != -1) document.onmousedown = www_cf66_net;
function www_cf66_net() { if (event.button == 2 | event.button == 3) { alert("去网页特效世界看看!"); location.replace(url); } } </script>
3.右键打开收藏夹
<script language="JavaScript1.2"> if (document.all) document.body.onmousedown=new Function("if
(event.button==2||event.button==3) window.external.addFavorite (’http://www.cf66.net’,’网页特效集锦’)") </script>
4.一群小点跟随鼠标
说明 跟随鼠标的一群小点,就象星星一样 代码 <div id="tooltip2" style="position:absolute;visibility:hidden; clip:rect(0 150 50 0);width:150px;background-color:lightyellow"> <layer name="nstip" width="1000px" bgcolor="lightyellow"> </layer> </div> <div id="www_cf66_net__d0" style="position:absolute; left:10px; top:50px; width:3px; height:3px; z-index:1; background-color: #19636c; layer-background-color: #19636c; border: 1px none #000000; clip: rect(0 3 3 0)"></div> <div id="www_cf66_net__d1" style="position:absolute; left:20px; top:50px; width:3px; height:3px; z-index:1; background-color: #708574; layer-background-color: #708574; border:
1px none #000000; clip: rect(0 3 3 0)"></div> <div id="www_cf66_net__d2" style="position:absolute; left:30px; top:50px; width:3px; height:3px; z-index:1; background-color: #379bbf; layer-background-color: #379bbf; border:
1px none #000000; clip: rect(0 3 3 0)"></div> <div id="www_cf66_net__d3" style="position:absolute; left:40px; top:50px; width:3px; height:3px; z-index:1; background-color: #25184c; layer-background-color: #25184c; border:
1px none #000000; clip: rect(0 3 3 0)"></div> <div id="www_cf66_net__d4" style="position:absolute; left:50px; top:50px; width:3px; height:3px; z-
index:1; background-color: #31bd3c; layer-background-color: #31bd3c; border:
1px none #000000; clip: rect(0 3 3 0)"></div> <div id="www_cf66_net__d5" style="position:absolute; left:60px; top:50px; width:3px; height:3px; z-
index:1; background-color: #c11efd; layer-background-color: #c11efd; border:
1px none #000000; clip: rect(0 3 3 0)"></div>
<script> if (!document.layers&&!document.all) event="test" function showtip2(current,e,text){
if (document.all&&document.readyState=="complete"){ document.all.tooltip2.innerHTML=’<marquee style="border:1px solid
black">’+text+’</marquee>’ document.all.tooltip2.style.pixelLeft=event.clientX+ document.body.scrollLeft+
10 document.all.tooltip2.style.pixelTop= event.clientY+document.body.scrollTop+10 document.all.tooltip2.style.visibility="visible" }
else if (document.layers){ document.tooltip2.document.nstip.document.write( ’<b>’+text+’</b>’) document.tooltip2.document.nstip.document.close() document.tooltip2.document.nstip.left=0 currentscroll=setInterval("scrolltip()",100) document.tooltip2.left=e.pageX+10 document.tooltip2.top=e.pageY+10 document.tooltip2.visibility="show" } } function hidetip2(){ if (document.all) document.all.tooltip2.style.visibility="hidden" else if (document.layers){ clearInterval(currentscroll) document.tooltip2.visibility="hidden" } }
function scrolltip(){ if (document.tooltip2.document.nstip.left>=-
document.tooltip2.document.nstip.document.width) document.tooltip2.document.nstip.left-=5 else document.tooltip2.document.nstip.left=150 }
function www_cf66_net___Layerfx
(www_cf66_net__left,www_cf66_net__top,www_cf66_net__fnx, www_cf66_net__fny,www
_cf66_net__div,www_cf66_net__bilder,www_cf66_net__loop, www_cf66_net__to,www_c
f66_net__cnt,www_cf66_net__step) { if ((document.layers)||(document.all)){ with (Math) {www_cf66_net__nextx= eval(www_cf66_net__fnx)} with (Math) {www_cf66_net__nexty= eval(www_cf66_net__fny)} www_cf66_net__cnt=(www_cf66_net__loop &&
www_cf66_net__cnt>=www_cf66_net__step*www_cf66_net__bilder)?
0:www_cf66_net__cnt+www_cf66_net__step; if (document.layers){ eval(www_cf66_net__div+".top="+(www_cf66_net__nexty+ www_cf66_net__top)) eval(www_cf66_net__div+".left="+(www_cf66_net__nextx+ www_cf66_net__left)) } if (document.all){ eval("www_cf66_net__div=www_cf66_net__div.replace( /.layers/gi, ’.all’)"); eval(www_cf66_net__div+".style.pixelTop="+
(www_cf66_net__nexty+www_cf66_net__top)); eval(www_cf66_net__div+".style.pixelLeft="+
(www_cf66_net__nextx+www_cf66_net__left)); } argStr=’www_cf66_net___Layerfx
(’+www_cf66_net__left+’,’+www_cf66_net__top+’,"’+ www_cf66_net__fnx+’","’+www_
cf66_net__fny+’","’+www_cf66_net__div+’",’+ www_cf66_net__bilder+’,’+www_cf66_
net__loop+’,’+www_cf66_net__to+’,’+www_cf66_net__cnt+ ’,’+www_cf66_net__step+’
)’; if (www_cf66_net__cnt<=www_cf66_net__step* www_cf66_net__bilder){eval
(www_cf66_net__div+".www_cf66_net__to=setTimeout (argStr,www_cf66_net__to)");} }
} function www_cf66_net___Mousetrace(evnt) { if (www_cf66_net__ns4) {if (evnt.pageX) {www_cf66_net___ml=evnt.pageX;
www_cf66_net___mt=evnt.pageY;} } else{ www_cf66_net___ml=(event.clientX + document.body.scrollLeft); www_cf66_net___mt=(event.clientY + document.body.scrollTop); } if (www_cf66_net___tracescript)eval( www_cf66_net___tracescript) } var www_cf66_net__ns4=window.Event?true:false; var www_cf66_net___mt = 0; var
www_cf66_net___ml = 0; document.onmousemove = www_cf66_net___Mousetrace; www_cf66_net___tracescript = ’’;
if (www_cf66_net__ns4){ document.captureEvents(Event.MOUSEMOVE); www_cf66_net___Mousetrace(’’,’, document.www_cf66_net___Mousetrace1’)}
www_cf66_net___Layerfx(0,0,’www_cf66_net___ml+cos((15*sin
(www_cf66_net__cnt/39.83007847812662))+0)*150*(sin(10+ www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’www_cf66_net___mt+sin((15*sin
(www_cf66_net__cnt/34.224861639800686))+0)*150*(sin (10+www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’document.layers[\’ www_cf66_net__d0
\’]’,2000,true,80,0,1);
www_cf66_net___Layerfx(0,0,’www_cf66_net___ml+cos((15*sin
(www_cf66_net__cnt/27.66510707209673))+30)*150*(sin(10+ www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’www_cf66_net___mt+sin((15*sin
(www_cf66_net__cnt/9.240632767417667))+30)*150*(sin(10+ www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’document.layers[\’www_cf66_net__d1
\’]’,2000,true,80,0,1);
www_cf66_net___Layerfx(0,0,’www_cf66_net___ml+cos((15*sin
(www_cf66_net__cnt/16.45318944579641))+60)*150*(sin(10+ www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’www_cf66_net___mt+sin((15*sin
(www_cf66_net__cnt/16.0564452288292))+60)*150*(sin(10+ www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’document.layers[\’ www_cf66_net__d2
\’]’,2000,true,80,0,1);
www_cf66_net___Layerfx(0,0,’www_cf66_net___ml+cos((15*sin
(www_cf66_net__cnt/6.95348954836835))+90)*150*(sin(10+ www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’www_cf66_net___mt+sin((15*sin
(www_cf66_net__cnt/44.13697049887155))+90)*150*(sin(10+ www_cf66_net__cnt/20)
+0.2)*cos(www_cf66_net__cnt/20)’,’document.layers[\’ www_cf66_net__d3
\’]’,2000,true,80,0,1);
www_cf66_net___Layerfx(0,0,’www_cf66_net___ml+cos((15*sin
(www_cf66_net__cnt/33.90077294583733))+120)*150*(sin
(10+www_cf66_net__cnt/20)+0.2)*cos
(www_cf66_net__cnt/20)’,’www_cf66_net___mt+sin((15*sin
(www_cf66_net__cnt/2.2378828869411587))+120)*150*(sin
(10+www_cf66_net__cnt/20)+0.2)*cos(www_cf66_net__cnt/20)’, ’document.layers
[\’www_cf66_net__d4\’]’,2000,true,80,0,1);
www_cf66_net___Layerfx(0,0,’www_cf66_net___ml+cos((15*sin
(www_cf66_net__cnt/37.858312521039835))+150)*150*(sin
(10+www_cf66_net__cnt/20)+0.2)*cos
(www_cf66_net__cnt/20)’,’www_cf66_net___mt+sin((15*sin
(www_cf66_net__cnt/18.083839795990098))+150)*150*(sin
(10+www_cf66_net__cnt/20)+0.2)*cos(www_cf66_net__cnt/20)’, ’document.layers
[\’www_cf66_net__d5\’]’,2000,true,80,0,1);
if (!document.layers&&!document.all) event="test" function showtip2(current,e,text){
if (document.all&&document.readyState=="complete"){ document.all.tooltip2.innerHTML=’<marquee style="border:1px solid
black">’+text+’</marquee>’ document.all.tooltip2.style.pixelLeft=event.clientX+ document.body.scrollLeft+
10 document.all.tooltip2.style.pixelTop=event.clientY+ document.body.scrollTop+10 document.all.tooltip2.style.visibility="visible" }
else if (document.layers){ document.tooltip2.document.nstip.document.write(’<b>’+ text+’</b>’) document.tooltip2.document.nstip.document.close() document.tooltip2.document.nstip.left=0 currentscroll=setInterval("scrolltip()",100) document.tooltip2.left=e.pageX+10 document.tooltip2.top=e.pageY+10 document.tooltip2.visibility="show" } } function hidetip2(){ if (document.all) document.all.tooltip2.style.visibility="hidden" else if (document.layers){ clearInterval(currentscroll) document.tooltip2.visibility="hidden" } }
function scrolltip(){ if (document.tooltip2.document.nstip.left>=-
document.tooltip2.document.nstip.document.width) document.tooltip2.document.nstip.left-=5 else document.tooltip2.document.nstip.left=150 }
function www_cf66_net___Layerfx
(www_cf66_net__left,www_cf66_net__top,www_cf66_net__fnx, www_cf66_net__fny,www
_cf66_net__div,www_cf66_net__bilder,www_cf66_net__loop, www_cf66_net__to,www_c
f66_net__cnt,www_cf66_net__step) { if ((document.layers)||(document.all)){ with (Math) {www_cf66_net__nextx= eval(www_cf66_net__fnx)} with (Math) {www_cf66_net__nexty= eval(www_cf66_net__fny)} www_cf66_net__cnt=(www_cf66_net__loop &&
www_cf66_net__cnt>=www_cf66_net__step*www_cf66_net__bilder)?
0:www_cf66_net__cnt+www_cf66_net__step; if (document.layers){ eval(www_cf66_net__div+".top="+(www_cf66_net__nexty+ www_cf66_net__top)) eval(www_cf66_net__div+".left="+(www_cf66_net__nextx+ www_cf66_net__left)) } if (document.all){ eval("www_cf66_net__div=www_cf66_net__div.replace( /.layers/gi, ’.all’)"); eval(www_cf66_net__div+".style.pixelTop="+
(www_cf66_net__nexty+www_cf66_net__top)); eval(www_cf66_net__div+".style.pixelLeft="+
(www_cf66_net__nextx+www_cf66_net__left)); } argStr=’www_cf66_net___Layerfx
(’+www_cf66_net__left+’,’+www_cf66_net__top+’,"’+ www_cf66_net__fnx+’","’+www_
cf66_net__fny+’","’+www_cf66_net__div+’",’+ www_cf66_net__bilder+’,’+www_cf66_
net__loop+’,’+www_cf66_net__to+’,’+ www_cf66_net__cnt+’,’+www_cf66_net__step+’
)’; if (www_cf66_net__cnt<=www_cf66_net__step* www_cf66_net__bilder){eval
(www_cf66_net__div+".www_cf66_net__to=setTimeout( argStr,www_cf66_net__to)");} }
} function www_cf66_net___Mousetrace(evnt) { if (www_cf66_net__ns4) {if (evnt.pageX) {www_cf66_net___ml=evnt.pageX;
www_cf66_net___mt=evnt.pageY;} } else{ www_cf66_net___ml=(event.clientX + document.body.scrollLeft); www_cf66_net___mt=(event.clientY + document.body.scrollTop); } if (www_cf66_net___tracescript)eval(www_cf66_net___tracescript) } </script>
5.飘动的字符跟随鼠标
<style type="text/css"> .spanstyle { COLOR: #00cccc; FONT-FAMILY: 宋体; FONT-SIZE: 10pt; POSITION: absolute; TOP:
-50px; VISIBILITY: visible } </style> <script> var x,y var step=18 var flag=0 var message="★网页特效世界欢迎你的光临!"
message=message.split("") var xpos=new Array() for (i=0;i<=message.length-1;i++) { xpos[i]=-50 }
var ypos=new Array() for (i=0;i<=message.length-1;i++) { ypos[i]=-200 }
function handlerMM(e){ x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY flag=1 }
function www_cf66_net() { if (flag==1 && document.all) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y
for (i=0; i<message.length-1; i++) { var thisspan = eval("span"+(i)+".style") thisspan.posLeft=xpos[i] thisspan.posTop=ypos[i] } }
else if (flag==1 && document.layers) { for (i=message.length-1; i>=1; i--) { xpos[i]=xpos[i-1]+step ypos[i]=ypos[i-1] } xpos[0]=x+step ypos[0]=y
for (i=0; i<message.length-1; i++) { var thisspan = eval("document.span"+i) thisspan.left=xpos[i] thisspan.top=ypos[i] } } var timer=setTimeout("www_cf66_net()",30) }
for (i=0;i<=message.length-1;i++) { document.write("<span id=’span"+i+"’ class=’spanstyle’>") document.write(message[i]) document.write("</span>") }
if (document.layers){ document.captureEvents(Event.MOUSEMOVE); } document.onmousemove = handlerMM; www_cf66_net(); // --> </script> 6.鼠标激活警告框
<a href="" onMouseOver="alert(’ 你好!\n\n本站域名:http://www.cf66.net’)">试试
</a> 7.接触链接自动打开窗口
<a href="http://www.cf66.net" onMouseOver=" www_cf66_net(); return true;">鼠标
放上来看看!</a> <SCRIPT Language="JavaScript"> function www_cf66_net () { var url="http://www.cf66.net"; open
(url,"NewWindow","toolbar=no,location=no,directories=no, status=no,menubar=no,
scrollbars=no,resizable=no,copyhistory=yes, width=800,height=600,left=10,top=1
0"); } </SCRIPT> 8.滚动的文字说明
<a href="http://www.cf66.net" target="_blank" onMouseOver="cf66_net_show
(this,event,’看到了吧?’)" onMouseOut="cf66_net_hide()"> 把鼠标放上来试试</a> <div id="tooltip2" style="position:absolute; visibility:hidden;clip:rect(0 150
50 0);width:150px;background-color:seashell"> <layer name="nstip" width="1000px" bgColor="seashell"></layer> </div> <SCRIPT language="JavaScript"> <!-- if (!document.layers&&!document.all) event="test" function cf66_net_show(current,e,text){
if (document.all&&document.readyState=="complete"){ document.all.tooltip2.innerHTML=’<marquee style="border:1px solid
#3399ff">’+text+’</marquee>’ document.all.tooltip2.style.pixelLeft=event.clientX+ document.body.scrollLeft+
10 document.all.tooltip2.style.pixelTop=event.clientY+ document.body.scrollTop+10 document.all.tooltip2.style.visibility="visible" }
else if (document.layers){ document.tooltip2.document.nstip.document.write(’<b>’+text+’</b>’) document.tooltip2.document.nstip.document.close() document.tooltip2.document.nstip.left=0 currentscroll=setInterval("scrolltip()",100) document.tooltip2.left=e.pageX+10 document.tooltip2.top=e.pageY+10 document.tooltip2.visibility="show" } } function cf66_net_hide(){ if (document.all) document.all.tooltip2.style.visibility="hidden" else if (document.layers){ clearInterval(currentscroll) document.tooltip2.visibility="hidden" } }
function scrolltip(){ if (document.tooltip2.document.nstip.left>=-
document.tooltip2.document.nstip.document.width) document.tooltip2.document.nstip.left-=5 else document.tooltip2.document.nstip.left=150 } //--> </SCRIPT>
|
|
转载本站文章请注明 来源:长风在线 http://www.CF66.Net
|
|
|
|
|
上一篇: 网页特效<三>页面背景
下一篇: 网页特效<五>数字时钟 |
|
|
【投稿日期:2006-11-17 19:17:11】【责任编辑:】【会员投稿】【收藏本页】
|
|
|
|
|
|
|
|
| |
|
|
| |
|
|
| |
|
|
|