设为首页 | 加入收藏
当前位置:首页>>网页特效>>页面导航特效>> 鼠标悬停于链接文字上就会出现会由小变大的字符

鼠标悬停于链接文字上就会出现会由小变大的字符

时间:2005-1-14 22:07:14 来源:本站收集整理 作者:佚名

要完成此效果需要两个步骤

第一步:把如下代码加入到<head>区域中

<STYLE>.ringstyle {
    COLOR: #ff0000; FONT-FAMILY: Verdana; FONT-SIZE: 5pt; POSITION: absolute; TOP: -50px;

VISIBILITY: visible
}

</STYLE>
<SCRIPT>
var x,y
var timer
var i_fontsize=0
var step=0
var thisx,thisy

function handlerMM(e){
    x = (document.layers) ? e.pageX : event.clientX
    y = (document.layers) ? e.pageY : event.clientY
}

function ringup() {
    if (document.all) {
        thisx = x
        thisy = y
        ringup2()
    }
}

function ringup2() {
    if (i_fontsize<=1530) {   
        document.all.ring.style.fontSize=i_fontsize
       

document.all.ring.style.color="rgb(255,"+Math.floor(i_fontsize/6)+","+Math.floor(i_fontsize/6)+")

"
        document.all.ring.style.posLeft=thisx-(Math.floor(i_fontsize/3))
        document.all.ring.style.posTop=thisy-(Math.floor(i_fontsize/1.4))   
        step+=4
        i_fontsize+=step
        timer=setTimeout("ringup(2)",50)
    }
    else {
        clearTimeout(timer)
        i_fontsize=0
        step=0
        document.all.ring.style.posTop=-10000
    }
}

document.onmousemove = handlerMM;
</SCRIPT>