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

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

script

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

페이지 정보

작성자 서방님 댓글 0건 조회 170회 작성일 07-08-11 15:47

본문

<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>

<!--
zoom(400,267,'myimage','in') 에서 400, 267 은
이미지의 실제 가로,세로 크기를 정확하게 넣어주셔야만 그 이미지 비율대로 확대 축소가 가능합니다
-->
| <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>

댓글목록

등록된 댓글이 없습니다.

Total 846건 30 페이지
게시물 검색

회원로그인

접속자집계

오늘
62
어제
302
최대
1,347
전체
155,123
Latest Crypto Fear & Greed Index

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