2007/05/11 | 博客代码特效大全(2)
类别(偶尔创作) | 评论(3) | 阅读(118) | 发表于 20:04

下面给大家推荐这个博客特效代码:

  1.鼠标后面跟着一串字(其他的不敢保证,但是我提供的觉得能用,如果不行,可能是在我发表是出了问题,请及时告诉我!)  以下是代码

<style type="text/css">

 

 


.spanstyle {
COLOR: #339900; 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_butong_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_butong_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_butong_net();
// -->
</script>

  2.鼠标右键个性菜单  以下是代码       (菜单内容可自行修改)

<div onmouseup="down=false" onmousedown="down=true;divleft=event.clientX-parseInt(plane.style.left);
divtop=event.clientY-parseInt(plane.style.top)" id="plane" style="DISPLAY: none; LEFT: 100px; CURSOR: hand; POSITION: absolute; TOP: 100px">
<div class="none" onmouseover="menuin();init()" style="Z-INDEX: 1; BACKGROUND: #707888; LEFT: 150px; WIDTH: 100px; CURSOR: default; COLOR: white; POSITION: absolute; TOP: 33px; HEIGHT: 19px" align="center">右键菜单</div>
<div class="none" id="item1" onmouseover="this.className='over';menuin()" style="Z-INDEX: 2; FILTER: alpha(opacity=0); LEFT: 50px; WIDTH: 99px; POSITION: absolute; TOP: 55px; HEIGHT: 19px" onmouseout="this.className='none';" align="center"><a href="http://www">与众不同</a></div>
<div class="none" id="item2" onmouseover="this.className='over';menuin()" style="Z-INDEX: 3; FILTER: alpha(opacity=0); LEFT: 250px; WIDTH: 99px; POSITION: absolute; TOP: 77px; HEIGHT: 19px" onmouseout="this.className='none';" align="center"><a href="#">菜单项二</a></div>
<div class="none" id="item3" onmouseover="this.className='over';menuin()" style="Z-INDEX: 4; FILTER: alpha(opacity=0); LEFT: 50px; WIDTH: 99px; POSITION: absolute; TOP: 99px; HEIGHT: 19px" onmouseout="this.className='none';" align="center">菜单项三</div>
<div class="none" id="item4" onmouseover="this.className='over';menuin()" style="Z-INDEX: 5; FILTER: alpha(opacity=0); LEFT: 250px; WIDTH: 99px; POSITION: absolute; TOP: 121px; HEIGHT: 19px" onmouseout="this.className='none';" align="center">菜单项四</div>
 
<div class="none" id="item5" onmouseover="this.className='over';menuin()" style="Z-INDEX: 6; FILTER: alpha(opacity=0); LEFT: 50px; WIDTH: 99px; POSITION: absolute; TOP: 143px; HEIGHT: 19px" onmouseout="this.className='none';" align="center">菜单项五</div>
</div>
<script language="vbs">
dim down,divleft,divtop,timelinestart,timelinestop,tidone,tidtwo,tidtree
down=false
timelinestart=0
timelinestop=0
sub document_onmousedown
if window.event.button=2 then
plane.style.display=""
plane.style.left=window.event.clientx-153
plane.style.top=window.event.clienty-35
end if
end sub
sub document_onmousemove
if down then
plane.style.left=window.event.clientx-divleft
plane.style.top=window.event.clienty-divtop
end if

end sub
sub document_ondargstart
window.event.returnvalue=false
end sub
function menuin()
cleartimeout(tidtree)
end function
sub document_onclick
tidtree=settimeout("outit()",200)
end sub
function init()
if timelinestart<>5 then
cleartimeout(tidtwo)
item1.style.pixelLeft=item1.style.pixelLeft+20
item1.filters.alpha.opacity=item1.filters.alpha.opacity+20
item2.style.pixelLeft=item2.style.pixelLeft-20
item2.filters.alpha.opacity=item2.filters.alpha.opacity+20
item3.style.pixelLeft=item3.style.pixelLeft+20
item3.filters.alpha.opacity=item3.filters.alpha.opacity+20
item4.style.pixelLeft=item4.style.pixelLeft-20
item4.filters.alpha.opacity=item4.filters.alpha.opacity+20
item5.style.pixelLeft=item5.style.pixelLeft+20
item5.filters.alpha.opacity=item5.filters.alpha.opacity+20
timelinestart=timelinestart+1
else
cleartimeout(tidone)
end if
tidone=settimeout("init()",1)
end function
function outit()
if timelinestart<>0 then
cleartimeout(tidone)
item1.style.pixelLeft=item1.style.pixelLeft-20
item1.filters.alpha.opacity=item1.filters.alpha.opacity-20
item2.style.pixelLeft=item2.style.pixelLeft+20
item2.filters.alpha.opacity=item2.filters.alpha.opacity-20
item3.style.pixelLeft=item3.style.pixelLeft-20
item3.filters.alpha.opacity=item3.filters.alpha.opacity-20
item4.style.pixelLeft=item4.style.pixelLeft+20
item4.filters.alpha.opacity=item4.filters.alpha.opacity-20
item5.style.pixelLeft=item5.style.pixelLeft-20
item5.filters.alpha.opacity=item5.filters.alpha.opacity-20
timelinestart=timelinestart-1
else
cleartimeout(tidtwo)
plane.style.display="none"
exit function
end if
tidtwo=settimeout("outit()",1)
end function
</script><center></center>


0

评论Comments