码迷,mamicode.com
首页 > 其他好文 > 详细

爆炸效果的超级链接文字

时间:2015-04-09 19:38:51      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:

<SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    document.write(<style><!--);
    document.write(.spanstyle { position:absolute;    visibility:hidden;});
    document.write(--></style>);
    var debrisnumber=40
    var debriscolor=new Array()
    debriscolor[0]="FFAAAA"
    debriscolor[1]="AA0000"
    debriscolor[2]="770000"
    debriscolor[3]="AA4444"
    debriscolor[4]="EE4422"
    var x_debrispos
    var y_debrispos
    var x,y
    var x_random=new Array()
    var y_random=new Array()
    var max_explsteps=20
    var i_explsteps=0
    var i_color=0
    var pause=10
    function checkbrowser() {
    i_explsteps=0
    x_debrispos=x
    y_debrispos=y
    for (i=0;i<=debrisnumber;i++) {
    x_random[i]=Math.ceil(40*Math.random())-20
    y_random[i]=Math.ceil(40*Math.random())-20
    }
    if (document.all) {
    for (i=0;i<=debrisnumber;i++) {
    var thisspan=eval("document.all.span"+i+".style")
    thisspan.visibility="VISIBLE"
    thisspan.posLeft=x_debrispos
    thisspan.posTop=y_debrispos
    }
    explode_IE()
    }
    if (document.layers) {
    for (i=0;i<=debrisnumber;i++) {
    var thisspan=eval("document.span"+i)
    thisspan.visibility="VISIBLE"
    thisspan.left=x_debrispos
    thisspan.top=y_debrispos
    }
    explode_NN()
    }
    }
    function explode_IE() {
    if (i_explsteps<=max_explsteps) {
    for (i=0;i<=debrisnumber;i++) {
    var thisspan=eval("document.all.span"+i+".style")
    thisspan.posLeft+=x_random[i]
    thisspan.posTop+=y_random[i]
    }
    i_explsteps++
    var timer=setTimeout("explode_IE()",pause)
    }
    else {
    for (i=0;i<=debrisnumber;i++) {
    var thisspan=eval("document.all.span"+i+".style")
    thisspan.visibility="HIDDEN"
    }
    clearTimeout(timer)
    }
    }
    function explode_NN() {
    if (i_explsteps<=max_explsteps) {
    for (i=0;i<=debrisnumber;i++) {
    var thisspan=eval("document.span"+i)
    thisspan.left+=x_random[i]
    thisspan.top+=y_random[i]
    }
    i_explsteps++
    var timer=setTimeout("explode_NN()",pause)
    }
    else {
    for (i=0;i<=debrisnumber;i++) {
    var thisspan=eval("document.span"+i)
    thisspan.visibility="HIDDEN"
    }
    clearTimeout(timer)
    }
    }
    function handlerMM(e){
    x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
    y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
    }
    if (document.layers){
    document.captureEvents(Event.MOUSEMOVE);
    }
    document.onmousemove = handlerMM;
    for (i=0;i<=debrisnumber;i++) {
    document.write("<div id=‘span"+i+"‘ class=‘spanstyle‘>")
    document.write("<table cellpadding=0 cellspacing=0>")
    document.write("<tr><td bgcolor="+debriscolor[i_color]+">")
    document.write("<img src=‘coolboo.gif‘ width=3>")
    document.write("</td></tr></table>")
    document.write("</div>")
    i_color++
    if (i_color>=debriscolor.length) {i_color=0}
    }
    // End -->
    </SCRIPT>
    <a href="http://www.zxlhf.com/" onMouseOver="checkbrowser()"><font size="2" color="#0000FF" face="宋体">鼠标移上来预览显示效果</font></a><br>
    <br><br><hr>
    

 

爆炸效果的超级链接文字

标签:

原文地址:http://www.cnblogs.com/youtianxia/p/4410178.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!