论坛: 网站建设 标题: 谁有鼠标特效的代码啊 ? 复制本贴地址    
作者: tour [tour]    论坛用户   登录
谁有鼠标特效的代码啊 ?鼠标后跟着一群小心或什么图的,谢谢拉!

地主 发表时间: 08/28 14:24

回复: tabris17 [tabris17]   论坛用户   登录
<STYLE>
.spanstyle {
position:absolute;
visibility:visible;
top:-50px;
font-size:10pt;
font-family:Verdana;
font-weight:bold;
color:#433059;
}
</STYLE>
</head>
<!--2、把你html文件的<body>部分改为-->
<body onLoad="makesnake()" style="width:100%;overflow-x:hidden;overflow-y:scroll">

<script>
var x,y
var step=20
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]=-50
}

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 makesnake() {
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("makesnake()",30)
}
</script>


<!--把下面代码加入你html文件<body>和</body>之间:-->
<script>
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;
</script> 

B1层 发表时间: 08/28 20:42

回复: yehanhang [yehanhang]   论坛用户   登录
你可以去www.free8.com,那里有很多


B2层 发表时间: 08/31 11:31

回复: xjy1234 [xjy1234]   论坛用户   登录
再给你一个大的.<html>
<head>
<title>看到都说受不了这个东东</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#000000">
<CENTER><SCRIPT LANGUAGE="JAVASCRIPT">
 <!--
 SiteName = "javascript";
 SiteTarget  = "_top";
 //-->
 </SCRIPT>
 <SCRIPT SRC="http://www.adsnow.net/AdsnowUniversal/BANNER" LANGUAGE="JAVASCRIPT"></SCRIPT>
 <br>
         
      </CENTER>
<LAYER NAME="a0" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffffff" CLIP="0,0,1,1"></LAYER>
<LAYER NAME="a1" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#fff000" CLIP="0,0,1,1"></LAYER>
<LAYER NAME="a2" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffa000" CLIP="0,0,1,1"></LAYER>
<LAYER NAME="a3" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ff00ff" CLIP="0,0,1,1"></LAYER>
<LAYER NAME="a4" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#00ff00" CLIP="0,0,1,1"></LAYER>
<LAYER NAME="a5" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF00FF" CLIP="0,0,1,1"></LAYER>
<LAYER NAME="a6" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF0000" CLIP="0,0,1,1"></LAYER>
<LAYER NAME="a7" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffffff" CLIP="0,0,2,2"></LAYER>
<LAYER NAME="a8" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#fff000" CLIP="0,0,2,2"></LAYER>
<LAYER NAME="a9" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ffa000" CLIP="0,0,2,2"></LAYER>
<LAYER NAME="a10" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#ff00ff" CLIP="0,0,2,2"></LAYER>
<LAYER NAME="a11" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#00ff00" CLIP="0,0,2,2"></LAYER>
<LAYER NAME="a12" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#0000ff" CLIP="0,0,2,2"></LAYER>
<LAYER NAME="a13" LEFT=10 TOP=10 VISIBILITY=SHOW BGCOLOR="#FF0000" CLIP="0,0,3,3"></LAYER>
<div id="starsDiv" style="position:absolute;top:0px;left:0px">
<div style="position:relative;width:1px;height:1px;background:#ffffff;font-size:1px;visibility:visible"></div>
<div style="position:relative;width:1px;height:1px;background:#fff000;font-size:1px;visibility:visible"></div>
<div style="position:relative;width:1px;height:1px;background:#ffa000;font-size:1px;visibility:visible"></div>
<div style="position:relative;width:1px;height:1px;background:#ff00ff;font-size:1px;visibility:visible"></div>
<div style="position:relative;width:1px;height:1px;background:#00ff00;font-size:1px;visibility:visible"></div>
<div style="position:relative;width:1px;height:1px;background:#0000ff;font-size:1px;visibility:visible"></div>
<div style="position:relative;width:1px;height:1px;background:#FF0000;font-size:1px;visibility:visible"></div>
<div style="position:relative;width:2px;height:2px;background:#ffffff;font-size:2px;visibility:visible"></div>
<div style="position:relative;width:2px;height:2px;background:#fff000;font-size:2px;visibility:visible"></div>
<div style="position:relative;width:2px;height:2px;background:#ffa000;font-size:2px;visibility:visible"></div>
<div style="position:relative;width:2px;height:2px;background:#ff00ff;font-size:2px;visibility:visible"></div>
<div style="position:relative;width:2px;height:2px;background:#00ff00;font-size:2px;visibility:visible"></div>
<div style="position:relative;width:2px;height:2px;background:#0000ff;font-size:2px;visibility:visible"></div>
<div style="position:relative;width:3px;height:3px;background:#FF0000;font-size:3px;visibility:visible"></div>
</div>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original:  Kurt Grigg (kurt.grigg@virgin.net) -->
<!-- Web Site:  http://freespace.virgin.net/kurt.grigg -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
var Clrs = new Array(6);
Clrs[0] = 'ff0000';
Clrs[1] = '00ff00';
Clrs[2] = '000aff';
Clrs[3] = 'ff00ff';
Clrs[4] = 'fff000';
Clrs[5] = 'fffff0';
var yBase = 200;
var xBase = 200;
var step;
var currStep = 0;
var Xpos = 1;
var Ypos = 1;
var Xs = 200;
var Ys = 400;
if (document.layers) {
window.captureEvents(Event.MOUSEMOVE);
}
if (document.all) {
function MoveHandler() {
Xpos = document.body.scrollLeft+event.x;
Ypos = document.body.scrollTop+event.y;
}
document.onmousemove = MoveHandler;
}
else if (document.layers) {
function xMoveHandler(evnt) {
Xpos = evnt.pageX;
Ypos = evnt.pageY;
}
window.onMouseMove = xMoveHandler;
}
function Comet() {
if (document.all) {
yBase = window.document.body.offsetHeight / 4;
xBase = window.document.body.offsetWidth / 4;
}
else if (document.layers) {
yBase = window.innerHeight / 4;
xBase = window.innerWidth / 4;
}
if (document.all) {
for ( i = 0 ; i < starsDiv.all.length ; i++ ) {
step = 3;
starsDiv.all[i].style.top = Ypos + yBase*Math.cos((currStep + i*4)/12)*Math.cos(0.7+currStep/200);
starsDiv.all[i].style.left = Xpos + xBase*Math.sin((currStep + i*3)/10)*Math.sin(8.2+currStep/400);
for (ai = 0; ai < Clrs.length; ai++) {
var c=Math.round(Math.random()*[ai]);
}
starsDiv.all[i].style.background = Clrs[c];
   }
}
else if (document.layers) {
for ( j = 0 ; j < 14 ; j++ ) { //number of NS layers!
step = 6;
var templayer = "a"+j;
document.layers[templayer].top = Ypos + yBase*Math.cos((currStep + j*4)/12)*Math.cos(0.7+currStep/200);
document.layers[templayer].left = Xpos + xBase*Math.sin((currStep + j*3)/10)*Math.sin(8.2+currStep/400);
for (aj=0; aj < Clrs.length; aj++)
{
 var c=Math.round(Math.random()*[aj]);
}
document.layers[templayer].bgColor = Clrs[c]; 
   }
}
currStep += step;
setTimeout("Comet()", 5);
}
Comet();
//  End -->
</script>

</body>
</html>




B3层 发表时间: 09/01 08:27

回复: BlueSnoopy [bluesnoopy]   论坛用户   登录
还有没有啊?

B4层 发表时间: 09/07 15:28

回复: xieyixin2 [xieyixin2]   论坛用户   登录
用CSS就可以做出漂亮的鼠标效果。。。

B5层 发表时间: 09/10 10:58

回复: BlueSnoopy [bluesnoopy]   论坛用户   登录
css是什么来的,我不懂!

B6层 发表时间: 09/11 21:58

回复: runwin [runwin]   论坛用户   登录
CSS 文件就是样式表文件啊!

B7层 发表时间: 09/12 17:03

回复: fbi_007 [fbi_007]   论坛用户   登录
你可以到http://vs2.b8.cn4e.com/vs2/index.htm 那看看也许有你要的东东啊 都是现成的原代码啊  你看看把 

B8层 发表时间: 09/13 01:09

回复: shyboy [mayipo]   论坛用户   登录
晕啊,上面的代码到底要怎么用啊!!!
我怎么不会用啊!
说的清楚一点啊~
拜托谁给我解释以下啊!!!

B9层 发表时间: 09/28 08:37

回复: chenwfy [chenwfy]   论坛用户   登录
我晕――――

你去网上直接搜索网页特效,要多少有多少啊,而且都讲解的很详细的了,呵呵~!

去http://www.google.com搜索

B10层 发表时间: 09/28 19:04

回复: hangmeng [hangmeng]   论坛用户   登录
去hao123.com中网页特效锦集看看吧那里有很多特效

B11层 发表时间: 01/19 22:36

回复: sunrain [sunrain]   论坛用户   登录
希望以后多发点这样的文章!

B12层 发表时间: 01/21 19:49

论坛: 网站建设

20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon

粤ICP备05087286号