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

· 15년 전 · 1950

 

<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,351
15년 전 조회 1,529
15년 전 조회 1,500
15년 전 조회 1,405
15년 전 조회 1,282
15년 전 조회 1,218
15년 전 조회 1,571
15년 전 조회 1,517
15년 전 조회 1,295
15년 전 조회 1,250
15년 전 조회 1,432
15년 전 조회 1,898
15년 전 조회 1,435
15년 전 조회 1,744
15년 전 조회 1,584
15년 전 조회 2,297
15년 전 조회 3,314
15년 전 조회 2,676
15년 전 조회 1,239
15년 전 조회 2,249
15년 전 조회 2,473
15년 전 조회 1,747
15년 전 조회 1,718
15년 전 조회 2,993
15년 전 조회 2,900
15년 전 조회 5,904
15년 전 조회 1,846
15년 전 조회 4,621
15년 전 조회 1,729
15년 전 조회 2,001
15년 전 조회 1,985
15년 전 조회 1,982
15년 전 조회 1,469
15년 전 조회 1,709
15년 전 조회 1,850
15년 전 조회 1,780
15년 전 조회 2,479
15년 전 조회 1,643
15년 전 조회 1,756
15년 전 조회 1,240
15년 전 조회 1,339
15년 전 조회 1,328
15년 전 조회 1,284
15년 전 조회 1,237
15년 전 조회 1,281
15년 전 조회 1,417
15년 전 조회 1,462
15년 전 조회 2,959
15년 전 조회 1,298
15년 전 조회 1,951
15년 전 조회 1,831
15년 전 조회 1,962
15년 전 조회 1,653
15년 전 조회 2,163
15년 전 조회 963
15년 전 조회 1,439
15년 전 조회 1,414
15년 전 조회 3,189
15년 전 조회 3,562
15년 전 조회 2,238
15년 전 조회 1,703
15년 전 조회 2,315
15년 전 조회 1,804
15년 전 조회 1,428
15년 전 조회 4,118
15년 전 조회 1,780
15년 전 조회 1,843
15년 전 조회 3,130
15년 전 조회 1,818
15년 전 조회 4,513
15년 전 조회 2,714
15년 전 조회 3,497
15년 전 조회 2,124
15년 전 조회 2,353
15년 전 조회 1,647
15년 전 조회 4,704
15년 전 조회 4,339
15년 전 조회 4,147
16년 전 조회 5,547
16년 전 조회 3,768
16년 전 조회 2,142
16년 전 조회 2,086
16년 전 조회 2,234
16년 전 조회 1,929
16년 전 조회 4,359
16년 전 조회 3,266
16년 전 조회 2,432
16년 전 조회 2,018
16년 전 조회 2,214
16년 전 조회 2,719
16년 전 조회 1,799
16년 전 조회 2,731
16년 전 조회 2,051
16년 전 조회 2,189
16년 전 조회 1,826
16년 전 조회 2,529
16년 전 조회 1,846
16년 전 조회 2,270
16년 전 조회 2,429
16년 전 조회 1,523