본문 바로가기

javascript

커서를 대면 하이퍼링크의 설명문이 점점 커지는 스크립트

<!--1. 아래 스크립트를 HEAD 부분에 복사해 넣으세요. 없으면 그냥 두세요-->
<Script>

<!--
// Copyright (c) 2000 Peter Gehrig and Urs Dudli. All rights reserved.
// Additional scripts can be found at http://www.24fun.com/fast/index.html
// info@24fun.com

var x,y
var timer
var i_fadestrength=5
var step=1
var maxfontsize=180
var fontsizefactor=maxfontsize/100
var content

function cursorposition(e){
        x=event.clientX+document.body.scrollLeft
        y=event.clientY+document.body.scrollTop
}

function showmessage(whatmessage, whatfont, whatcolor) {
        if (document.all) {
                content="<nobr><font color="+whatcolor+" face="+whatfont+">"+whatmessage+"</font><nobr>"
                ring.innerHTML=content
                resizemessage()
        }
}

function resizemessage() {
if (document.all) {
        ring.filters.alpha.opacity=Math.floor(100-i_fadestrength)
        if (i_fadestrength>=120) {i_fadestrength=0;step=1}
        document.all.ring.style.visibility="visible"
        document.all.ring.style.fontSize=i_fadestrength*fontsizefactor
        document.all.ring.style.posLeft=x-(Math.floor(i_fadestrength/1.3*fontsizefactor))
        document.all.ring.style.posTop=y-(Math.floor(i_fadestrength/1.4*fontsizefactor))        
        step+=1.5
        i_fadestrength+=step
        timer=setTimeout("resizemessage()",50)
}
}

function hidemessage(e){
if (document.all) {
        clearTimeout(timer)
        document.all.ring.style.visibility="hidden"
        i_fadestrength=5
        step=1
}
}

if (document.all) {
        document.onmousemove=cursorposition;
}

if (document.all) {
        document.write("<DIV id='ring' style='position:absolute;font-family:Verdana;filter:alpha(opacity=0);'></DIV>")
        document.write("<DIV style='position:relative;'>")
}
    
//-->
</script>
</HEAD>

<!--2. BODY 태그내에 onload="" 혹은 onunload 부분이 있으면 복사해 넣으세요-->

<BODY BGCOLOR="#FFFFFF">

<!--3. BODY 부분에 아래의 스크립트를 복사해 넣으세요-->

<CENTER><a href="http://www.bizs.wo.ro" onMouseOver="showmessage('JavaScript','Arial','blue')" onMouseOut="hidemessage()">여기에 마우스를 대어보세요</a></CENTER>