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

· 15년 전 · 1867

 

<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에서 이동 됨]
|
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

태그 필터 (최대 3개) 전체 개발자 소스 기타 mysql 팁자료실 javascript php linux flash 정규표현식 jquery node.js mobile 웹서버 os 프로그램 강좌 썸네일 이미지관련 도로명주소 그누보드5 기획자 견적서 계약서 기획서 마케팅 제안서 seo 통계 서식 통계자료 퍼블리셔 html css 반응형 웹접근성 퍼블리싱 표준화 반응형웹 홈페이지기초 부트스트랩 angularjs 포럼 스크린리더 센스리더 개발자톡 개발자팁 퍼블리셔톡 퍼블리셔팁 기획자톡 기획자팁 프로그램강좌 퍼블리싱강좌
+
제목 글쓴이 날짜 조회
15년 전 조회 1,272
15년 전 조회 1,439
15년 전 조회 1,426
15년 전 조회 1,330
15년 전 조회 1,195
15년 전 조회 1,128
15년 전 조회 1,486
15년 전 조회 1,436
15년 전 조회 1,204
15년 전 조회 1,165
15년 전 조회 1,338
15년 전 조회 1,809
15년 전 조회 1,348
15년 전 조회 1,659
15년 전 조회 1,494
15년 전 조회 2,227
15년 전 조회 3,225
15년 전 조회 2,588
15년 전 조회 1,162
15년 전 조회 2,166
15년 전 조회 2,375
15년 전 조회 1,675
15년 전 조회 1,635
15년 전 조회 2,909
15년 전 조회 2,830
15년 전 조회 5,829
15년 전 조회 1,754
15년 전 조회 4,563
15년 전 조회 1,650
15년 전 조회 1,917
15년 전 조회 1,901
15년 전 조회 1,888
15년 전 조회 1,387
15년 전 조회 1,630
15년 전 조회 1,778
15년 전 조회 1,685
15년 전 조회 2,397
15년 전 조회 1,559
15년 전 조회 1,683
15년 전 조회 1,160
15년 전 조회 1,258
15년 전 조회 1,244
15년 전 조회 1,205
15년 전 조회 1,143
15년 전 조회 1,194
15년 전 조회 1,337
15년 전 조회 1,376
15년 전 조회 2,881
15년 전 조회 1,208
15년 전 조회 1,868
15년 전 조회 1,745
15년 전 조회 1,864
15년 전 조회 1,572
15년 전 조회 2,063
15년 전 조회 880
15년 전 조회 1,343
15년 전 조회 1,325
15년 전 조회 3,101
15년 전 조회 3,487
15년 전 조회 2,176
15년 전 조회 1,612
15년 전 조회 2,232
15년 전 조회 1,724
15년 전 조회 1,347
15년 전 조회 4,037
15년 전 조회 1,698
15년 전 조회 1,772
15년 전 조회 3,058
15년 전 조회 1,748
15년 전 조회 4,428
15년 전 조회 2,633
15년 전 조회 3,408
15년 전 조회 2,043
15년 전 조회 2,273
15년 전 조회 1,557
15년 전 조회 4,618
15년 전 조회 4,275
15년 전 조회 4,072
15년 전 조회 5,456
15년 전 조회 3,698
15년 전 조회 2,059
15년 전 조회 2,009
15년 전 조회 2,151
16년 전 조회 1,854
16년 전 조회 4,298
16년 전 조회 3,182
16년 전 조회 2,347
16년 전 조회 1,933
16년 전 조회 2,141
16년 전 조회 2,643
16년 전 조회 1,720
16년 전 조회 2,643
16년 전 조회 1,968
16년 전 조회 2,101
16년 전 조회 1,750
16년 전 조회 2,444
16년 전 조회 1,764
16년 전 조회 2,190
16년 전 조회 2,351
16년 전 조회 1,442