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

· 15년 전 · 1589

 

<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년 전 조회 993
15년 전 조회 1,149
15년 전 조회 1,152
15년 전 조회 1,020
15년 전 조회 919
15년 전 조회 848
15년 전 조회 1,209
15년 전 조회 1,160
15년 전 조회 905
15년 전 조회 879
15년 전 조회 1,054
15년 전 조회 1,521
15년 전 조회 1,054
15년 전 조회 1,381
15년 전 조회 1,219
15년 전 조회 1,894
15년 전 조회 2,953
15년 전 조회 2,288
15년 전 조회 887
15년 전 조회 1,898
15년 전 조회 2,081
15년 전 조회 1,384
15년 전 조회 1,359
15년 전 조회 2,623
15년 전 조회 2,512
15년 전 조회 5,495
15년 전 조회 1,464
15년 전 조회 4,225
15년 전 조회 1,357
15년 전 조회 1,650
15년 전 조회 1,619
15년 전 조회 1,607
15년 전 조회 1,113
15년 전 조회 1,361
15년 전 조회 1,501
15년 전 조회 1,406
15년 전 조회 2,134
15년 전 조회 1,277
15년 전 조회 1,333
15년 전 조회 880
15년 전 조회 990
15년 전 조회 952
15년 전 조회 918
15년 전 조회 868
15년 전 조회 929
15년 전 조회 1,072
15년 전 조회 1,093
15년 전 조회 2,611
15년 전 조회 937
15년 전 조회 1,590
15년 전 조회 1,461
15년 전 조회 1,580
15년 전 조회 1,291
15년 전 조회 1,778
15년 전 조회 595
15년 전 조회 1,082
15년 전 조회 1,055
15년 전 조회 2,849
15년 전 조회 3,160
15년 전 조회 1,835
15년 전 조회 1,342
15년 전 조회 1,959
15년 전 조회 1,466
15년 전 조회 1,072
15년 전 조회 3,764
15년 전 조회 1,407
15년 전 조회 1,504
15년 전 조회 2,732
15년 전 조회 1,428
15년 전 조회 4,155
15년 전 조회 2,369
15년 전 조회 3,144
15년 전 조회 1,763
15년 전 조회 1,993
15년 전 조회 1,293
15년 전 조회 4,370
15년 전 조회 3,949
15년 전 조회 3,772
15년 전 조회 5,186
15년 전 조회 3,408
15년 전 조회 1,789
15년 전 조회 1,748
15년 전 조회 1,896
15년 전 조회 1,587
15년 전 조회 3,985
15년 전 조회 2,899
15년 전 조회 2,084
15년 전 조회 1,660
15년 전 조회 1,897
15년 전 조회 2,380
15년 전 조회 1,462
15년 전 조회 2,395
15년 전 조회 1,730
15년 전 조회 1,829
15년 전 조회 1,479
15년 전 조회 2,172
15년 전 조회 1,499
15년 전 조회 1,919
16년 전 조회 2,108
16년 전 조회 1,183
🐛 버그신고