본문 바로가기

javascript

하이퍼링크에 mouseOver 이벤트가 발생하면..???

<!--1. 아래의 스크립트를 <HEAD></HEAD>사이에 복사해 넣으세요-->

<script>
<!-- Beginning of JavaScript -

// 티커의 가로
var tickerwidth=120

// 티커의 높이
var tickerheight=100

// 티커와 내용 간격
var tickerpadding=5

// 티커 테두리 두께
var borderwidth=2

// 글꼴
var fnt="Verdana"

// 내용 텍스트 사이즈
var fntsize=10

// 내용 텍스트의 색상
var fntcolor="FFFFFF"

// 폰트 굵기(1-9)
var fntweight=9

// 배경색
var backgroundcolor="FF0000"

// 걸어가는 사람의 스텝 사이즈
var anistep=15

// 사람이 정지해 있는 시간
var anipause=80

var max_ani=4
var aniwidth=54
var aniheight=54
var x_posani=0
var y_posani=0
var x_posflower=0
var y_posflower=0
var screenwidth
var screenheight
var thisani
var i_ani=1
var xrange
var x=100
var y=0
var timer,timerbox
var message=" "
var messagecontent=" "
var clipleft=0
var clipright=tickerwidth
var cliptop=0
var clipbottom=0
fntweight=100*fntweight


function getmessagecontent() {        
                messagecontent="<table cellspacing=0 cellpadding="+tickerpadding+" width="+tickerwidth+" height="+tickerheight+" border="+borderwidth+"><tr><td valign=top bgcolor="+backgroundcolor+">"
                messagecontent+="<span style='position:relative; font-family:"+fnt+";color:"+fntcolor+";font-size:"+fntsize+"pt;font-weight:"+fntweight+"'>"        
                messagecontent+="<font color='"+fntcolor+"'>"
                messagecontent+=message
                messagecontent+="</font>"
                messagecontent+="</span>"
                messagecontent+="</td></tr></table>"
}


function initiate(thismessage) {
        clearTimeout(timer)
        clearTimeout(timerbox)
        clipbottom=0
        message=thismessage
        getmessagecontent()
        if (document.all) {
                flower.innerHTML=messagecontent
        screenwidth=document.body.clientWidth
        y_posani=y-30
        x_posani=0
        document.all.bottom1.style.posLeft=x_posani
        document.all.bottom1.style.posTop=y_posani
        thisani=eval("document.all.left"+i_ani+".style")
        }
        if (document.layers) {
                document.flower.document.write(messagecontent)
                document.flower.document.close()
                screenwidth=window.innerWidth
             y_posani=y-30
        x_posani=0
        document.bottom1.left=x_posani
        document.bottom1.top=y_posani
        thisani=eval("document.left"+i_ani)
        }
        movebottom1()
}

function stopanimation() {
        clearTimeout(timer)
        clearTimeout(timerbox)
        clipbottom=0
        if (document.all) {
                thisani.posLeft=-1000
                document.all.manurinating.style.posLeft=-1000
                document.all.flower.style.posLeft=-1000

        }
        if (document.layers) {
                document.manurinating.left=-1000
                document.flower.left=-1000
                document.bottom1.left=-1000
                document.bottom2.left=-1000
                document.bottom3.left=-1000
                document.bottom4.left=-1000
                document.right1.left=-1000
                document.right2.left=-1000
                document.right3.left=-1000
                document.right4.left=-1000
                document.top1.left=-1000
                document.top2.left=-1000
                document.top3.left=-1000
                document.top4.left=-1000
                document.left1.left=-1000
                document.left2.left=-1000
                document.left3.left=-1000
                document.left4.left=-1000
        }
}


function movebottom1() {
        if (x_posani<x-aniwidth) {
                x_posani+=anistep
                if (document.all) {
            thisani.posLeft=-2000
            thisani=eval("document.all.bottom"+i_ani+".style")
                        thisani.posLeft=x_posani
                        thisani.posTop=y_posani
                }
                if (document.layers) {
                        thisani.left=-2000
            thisani=eval("document.bottom"+i_ani)
                        thisani.left=x_posani
                        thisani.top=y_posani
                }
        i_ani++
        if (i_ani>max_ani) {i_ani=1}
                timer=setTimeout("movebottom1()",anipause)
        }
        else {
                clearTimeout(timer)
                x_posani-=anistep
                showurinator()
        }
}

function showurinator() {
                if (document.all) {
                        thisani.posLeft=-2000
                        manurinate.src="manurinating.gif"
            document.all.manurinating.style.posLeft=x_posani
            document.all.manurinating.style.posTop=y_posani
                }
                if (document.layers) {
                        thisani.left=-2000
                        document.manurinating.document.manurinate.src="manurinating.gif"
                        document.manurinating.left=x_posani
            document.manurinating.top=y_posani
                }
                timer=setTimeout("hideurinator()",2000)
}

function hideurinator() {
                if (document.all) {
            document.all.manurinating.style.posLeft=-2000
                        document.all.flower.style.posLeft=x-10
                      document.all.flower.style.posTop=y-10
                        document.all.flower.style.zIndex=100
                }
                if (document.layers) {
                        document.manurinating.left=-2000
                        document.flower.left=x-10
                document.flower.top=y-10
                        document.flower.zIndex=100
                }
                upmessagebox()
                movebottom2()
}

function upmessagebox() {
                if (clipbottom<=tickerheight) {
                        clipbottom+=2
                        if (document.all) {
                        document.all.flower.style.posTop-=2
                                document.all.flower.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                        }
                        if (document.layers) {
                                document.flower.top-=2
                                document.flower.clip.top=cliptop
                                document.flower.clip.bottom=clipbottom
                                document.flower.clip.left=clipleft
                                document.flower.clip.right=clipright
                        }
                        timerbox=setTimeout("upmessagebox()",50)
                }
                else {
                        clearTimeout(timerbox)
                        var timerdown=setTimeout("downmessagebox()",1000)
                }
}

function downmessagebox() {
                if (clipbottom>=0) {
                        clipbottom-=2
                        if (document.all) {
                        document.all.flower.style.posTop+=2
                                document.all.flower.style.clip ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
                        }
                        if (document.layers) {
                                document.flower.top+=2
                                document.flower.clip.top=cliptop
                                document.flower.clip.bottom=clipbottom
                                document.flower.clip.left=clipleft
                                document.flower.clip.right=clipright
                        }
                        timerbox=setTimeout("downmessagebox()",50)
                }
                else {
                        clearTimeout(timerbox)
                }
}

function movebottom2() {
        if (x_posani<screenwidth-aniheight) {
                x_posani+=anistep
                if (document.all) {
            thisani.posLeft=-2000
            thisani=eval("document.all.bottom"+i_ani+".style")
                        thisani.posLeft=x_posani
                        thisani.posTop=y_posani
                }
                if (document.layers) {
                        thisani.left=-2000
            thisani=eval("document.bottom"+i_ani)
                        thisani.left=x_posani
                        thisani.top=y_posani
                }
        i_ani++
        if (i_ani>max_ani) {i_ani=1}
                timer=setTimeout("movebottom2()",anipause)
        }
        else {
                clearTimeout(timer)
                x_posani-=anistep
                moveright()
        }
}

function moveright() {
        if (y_posani>0) {
                y_posani-=anistep
                if (document.all) {
            thisani.posLeft=-2000
            thisani=eval("document.all.right"+i_ani+".style")
                        thisani.posLeft=x_posani
                        thisani.posTop=y_posani
                }
                if (document.layers) {
                        thisani.left=-2000
            thisani=eval("document.right"+i_ani)
                        thisani.left=x_posani
                        thisani.top=y_posani
                }
        i_ani++
        if (i_ani>max_ani) {i_ani=1}
                timer=setTimeout("moveright()",anipause)
        }
        else {
                clearTimeout(timer)
                y_posani+=anistep/2
                movetop()
        }
}

function movetop() {
        if (x_posani>0) {
                x_posani-=anistep
                if (document.all) {
            thisani.posLeft=-2000
            thisani=eval("document.all.top"+i_ani+".style")
                        thisani.posLeft=x_posani
                        thisani.posTop=y_posani
                }
                if (document.layers) {
                        thisani.left=-2000
            thisani=eval("document.top"+i_ani)
                        thisani.left=x_posani
                        thisani.top=y_posani
                }
        i_ani++
        if (i_ani>max_ani) {i_ani=1}
                var timer=setTimeout("movetop()",anipause)
        }
        else {
                clearTimeout(timer)
                stopanimation()
        }
}

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
}

if (document.layers){
        document.captureEvents(Event.MOUSEMOVE);
}
document.onmousemove = handlerMM;

// - End of JavaScript - -->
</script>
</HEAD>

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

<BODY BGCOLOR="#000000" style="width:100%;overflow-x:hidden;overflow-y:hidden" link="FF0000" alink="FF0000" vlink="FF0000">

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

<DIV id="bottom1" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manbottom1.gif" border=0></A>
</DIV>

<DIV id="bottom2" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manbottom2.gif" border=0></A>
</DIV>

<DIV id="bottom3" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manbottom3.gif" border=0></A>
</DIV>

<DIV id="bottom4" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manbottom4.gif" border=0></A>
</DIV>


<DIV id="right1" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manright1.gif" border=0></A>
</DIV>

<DIV id="right2" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manright2.gif" border=0></A>
</DIV>

<DIV id="right3" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manright3.gif" border=0></A>
</DIV>

<DIV id="right4" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manright4.gif" border=0></A>
</DIV>


<DIV id="top1" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="mantop1.gif" border=0></A>
</DIV>

<DIV id="top2" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="mantop2.gif" border=0></A>
</DIV>

<DIV id="top3" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="mantop3.gif" border=0></A>
</DIV>

<DIV id="top4" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="mantop4.gif" border=0></A>
</DIV>

<DIV id="left1" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manleft1.gif" border=0></A>
</DIV>

<DIV id="left2" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manleft2.gif" border=0></A>
</DIV>

<DIV id="left3" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manleft3.gif" border=0></A>
</DIV>

<DIV id="left4" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manleft4.gif" border=0></A>
</DIV>

<DIV id="flower" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG SRC="manflower.gif" border=0></A>
</DIV>

<DIV id="manurinating" style="position:absolute;left:-5000px;">
<a href="http://www.24fun.com" target="_blank"><IMG name="manurinate" SRC="manurinating.gif" border=0></A>
</DIV>

<P>노동계, 노동절집회...충돌은 없어 : 민주노총, <a href="#" onMouseOver="initiate('안녕하세요? 방가워서 어쩌죠')" onMouseOut="stopanimation()"><b>한국노총 등 노동계</b></a>는 노동절을 맞은 1일 오후 서울 도심에서 각각 대규모 기념 집회를 갖고 도심 거리 행진을 벌였다<P>

<P>병역면제 청탁 2~3명 추가소환 : 박노항 원사 병역비리 사건을 수사중인 검찰과 군 당국은 1일 박 원사가 개입한 병역비리와 관련, 박씨에게 병역면제를 청탁한 관련자 2~3명을 추가로 소환, 청탁경위 등을 집중 조사중이다<P>


<P>어느 인터넷 쇼핑몰이 제일 쌀까? : <a href="http://bizserver.new21.net"  onMouseOver="initiate('최고의 자바스크립트 소스뱅크')" onMouseOut="stopanimation()"><b>인터넷 쇼핑몰</b></a> 이용이 급증하면서 여러 쇼핑몰의 가격을 비교해 한 눈에 볼 수 있도록 만든 「가격비교 사이트」가 인기다<P>