링크버튼에 마우스오버시 이미지 확대/축소 기능 > script

본문 바로가기
사이트 내 전체검색

script

링크버튼에 마우스오버시 이미지 확대/축소 기능

페이지 정보

작성자 서방님 댓글 2건 조회 292회 작성일 07-08-08 10:47

본문

출처 :  http://blueb.co.kr/bbs.php?table=JS_01&where=ALL&keyword=zoom&search_step=1&search_sql=BB_NAME%20LIKE%20'%zoom%'%20OR%20BB_SUBJECT%20LIKE%20'%zoom%'%20OR%20BB_CONTENT%20LIKE%20'%zoom%'&search_sql=BB_NAME%20LIKE%20'%zoom%'%20OR%20BB_SUBJECT%20LIKE%20'%zoom%'%20OR%20BB_CONTENT%20LIKE%20'%zoom%'&query=view&uid=35&p=1

 

 

| <a href="#" onmouseover="zoom(400,267,'myimage','in')" onmouseout="clearzoom()">Zoom In</a>
| <a href="#" onmouseover="zoom(400,267,'myimage','restore')">Normal</a>
| <a href="#" onmouseover="zoom(400,267,'myimage','out')" onmouseout="clearzoom()">Zoom Out</a>

위 노란색 부분은 이미지의 실제 가로,세로 크기를 정확하게 넣어주셔야만 그 이미지 비율대로 확대 축소가 가능합니다.


 

 

<script language="JavaScript1.2">
var zoomfactor=0.05

function zoomhelper(){
    if (parseInt(whatcache.style.width)>10&&parseInt(whatcache.style.height)>10){
        whatcache.style.width=parseInt(whatcache.style.width)+parseInt(whatcache.style.width)*zoomfactor*prefix
        whatcache.style.height=parseInt(whatcache.style.height)+parseInt(whatcache.style.height)*zoomfactor*prefix
    }
}

function zoom(originalW, originalH, what, state){
    if (!document.all&&!document.getElementById)
        return
        whatcache=eval("document.images."+what)
        prefix=(state=="in")? 1 : -1
    if (whatcache.style.width==""||state=="restore"){
        whatcache.style.width=originalW
        whatcache.style.height=originalH
    if (state=="restore")
        return
        }
    else {
    zoomhelper()
    }
    beginzoom=setInterval("zoomhelper()",100)
}

function clearzoom(){
    if (window.beginzoom)
    clearInterval(beginzoom)
}
</script>

| <a href="#" onmouseover="zoom(400,267,'myimage','in')" onmouseout="clearzoom()">Zoom In</a>
| <a href="#" onmouseover="zoom(400,267,'myimage','restore')">Normal</a>
| <a href="#" onmouseover="zoom(400,267,'myimage','out')" onmouseout="clearzoom()">Zoom Out</a>
<br>

<div style="position:relative;width:400;height:267">
<div><img name="myimage" src="http://www.blueb.co.kr/SRC/javascript/image/IMG_1041.gif" ></div>
</div>

 

댓글목록

심성진님의 댓글

심성진 작성일

<p>노란색 부분은 어디를 말하는 건가요?</p>

서방님님의 댓글

서방님 작성일

<p>상단 출처를 클릭해 보시면 쉽게 아실 수 있으십니다~*</p>
<p>찾아주셔서 감사합니다. ^^</p>

Total 846건 40 페이지
script 목록
번호 제목 글쓴이 조회 날짜
261 서방님 213 08-08
260 서방님 574 08-08
열람중 서방님 293 08-08
258 서방님 613 08-08
257 서방님 352 08-08
256 서방님 334 08-08
255 서방님 571 08-08
254 서방님 495 08-08
253 서방님 183 08-08
252 서방님 390 08-08
251 서방님 433 08-08
250 서방님 169 08-08
249 서방님 436 08-08
248 서방님 411 08-08
247 서방님 381 08-08
게시물 검색

회원로그인

접속자집계

오늘
588
어제
524
최대
2,142
전체
208,376
Latest Crypto Fear & Greed Index

그누보드5
Copyright © 서방님.kr All rights reserved.