마우스를 이미지 위에 올렸을때 이미지 흔들기

· 15년 전 · 1915

 

<style>
.shakeimage
{
position:relative
}
</style>

<script>
var rector=3
var stopit=0
var a=1

function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}

function rattleimage(){
if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
setTimeout("rattleimage()",50)
}
function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}
</script>

그 다음 스크립트는 넣었으면 <body></body>안에 있는 이미지중 스크립트를 적용시킬 이미지를 찾아서 이미지 태그안에 이렇게 추가합니다. <class="shakeimage" onMouseover="init(this);rattleimage()" onMouseout="stoprattle(this)">

[이 게시물은 관리자님에 의해 2011-10-31 16:57:14 JavaScript에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
15년 전 조회 1,312
15년 전 조회 1,493
15년 전 조회 1,470
15년 전 조회 1,376
15년 전 조회 1,244
15년 전 조회 1,180
15년 전 조회 1,534
15년 전 조회 1,485
15년 전 조회 1,263
15년 전 조회 1,210
15년 전 조회 1,396
15년 전 조회 1,862
15년 전 조회 1,400
15년 전 조회 1,710
15년 전 조회 1,551
15년 전 조회 2,272
15년 전 조회 3,274
15년 전 조회 2,636
15년 전 조회 1,212
15년 전 조회 2,216
15년 전 조회 2,426
15년 전 조회 1,721
15년 전 조회 1,680
15년 전 조회 2,960
15년 전 조회 2,874
15년 전 조회 5,879
15년 전 조회 1,811
15년 전 조회 4,603
15년 전 조회 1,707
15년 전 조회 1,963
15년 전 조회 1,951
15년 전 조회 1,941
15년 전 조회 1,437
15년 전 조회 1,681
15년 전 조회 1,822
15년 전 조회 1,747
15년 전 조회 2,448
15년 전 조회 1,611
15년 전 조회 1,730
15년 전 조회 1,210
15년 전 조회 1,308
15년 전 조회 1,296
15년 전 조회 1,250
15년 전 조회 1,201
15년 전 조회 1,249
15년 전 조회 1,390
15년 전 조회 1,429
15년 전 조회 2,925
15년 전 조회 1,261
15년 전 조회 1,916
15년 전 조회 1,791
15년 전 조회 1,921
15년 전 조회 1,616
15년 전 조회 2,124
15년 전 조회 926
15년 전 조회 1,396
15년 전 조회 1,376
15년 전 조회 3,153
15년 전 조회 3,535
15년 전 조회 2,213
15년 전 조회 1,661
15년 전 조회 2,288
15년 전 조회 1,774
15년 전 조회 1,394
15년 전 조회 4,076
15년 전 조회 1,748
15년 전 조회 1,816
15년 전 조회 3,112
15년 전 조회 1,800
15년 전 조회 4,475
15년 전 조회 2,682
15년 전 조회 3,460
15년 전 조회 2,089
15년 전 조회 2,320
15년 전 조회 1,612
15년 전 조회 4,671
15년 전 조회 4,318
15년 전 조회 4,123
16년 전 조회 5,515
16년 전 조회 3,745
16년 전 조회 2,106
16년 전 조회 2,055
16년 전 조회 2,203
16년 전 조회 1,905
16년 전 조회 4,340
16년 전 조회 3,235
16년 전 조회 2,403
16년 전 조회 1,982
16년 전 조회 2,188
16년 전 조회 2,690
16년 전 조회 1,774
16년 전 조회 2,701
16년 전 조회 2,017
16년 전 조회 2,150
16년 전 조회 1,798
16년 전 조회 2,494
16년 전 조회 1,824
16년 전 조회 2,240
16년 전 조회 2,399
16년 전 조회 1,493