跟随鼠标的字符,在鼠标后面跟着一串飘动的字符,自定义字符。
<html>
<head>
<meta name="keywords" content="站长,网页特效,js特效,广告代码,codesocang,codesocang.com,sky,www.codesocang.com,源码搜藏网" />
<meta name="description" content="www.codesocang.com,源码搜藏网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在源码搜藏网" />
<title>跟随鼠标的字符,在鼠标后面跟着一串飘动的字符,codesocang.com欢迎您。</title><style type="text/css">
.spanstyle {
COLOR: #3366ff; FONT-FAMILY: 宋体; FONT-SIZE: 10pt; POSITION: absolute; TOP: -50px; VISIBILITY: visible
}
</style>
<script>
var x, y
var step = 18
var flag = 0
// Your snappy message. Important: the space at the end of the sentence!!!
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
}
//欢迎来到源码搜藏网,我们的网址是www.codesocang.com,很好记,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
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
//欢迎来到源码搜藏网,我们的网址是www.codesocang.com,很好记,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
for (i = 0; i < message.length - 1; i++)
{
var thisspan = eval("span" + (i) + ".style")
thisspan.posLeft = xpos[i]
thisspan.posTop = ypos[i]
}
}
//欢迎来到源码搜藏网,我们的网址是www.codesocang.com,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。
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>
</head>
<body>
<body onload="makesnake()">
<a href="http://www.codesocang.com/">源码搜藏网</a>,站长必备的高质量网页特效和广告代码。codesocang.com,站长js特效。<hr>
<!--欢迎来到源码搜藏网,我们网站收集大量高质量js特效,提供许多广告代码下载,网址:www.codesocang.com,用.net打造靓站-->
<script>
<!-- Beginning of JavaScript -
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;
// - End of JavaScript - -->
</script>
</body>
</html>
相关内容推荐
热门源码