메뉴 건너뛰기

전국분동대여

일반 자료실

이미지 버튼에 마우스를 대면 커지는 효과를 보여줍니다

 

하나의 이미지로 롤오버 효과를 느끼게 할 수 있는 스크립트 입니다
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=euc-kr">
<TITLE> Script </TITLE>
<!---- [1단계] 아래의 스크립트를 HEAD 부분에 복사 해 넣으세요 ----->
<SCRIPT LANGUAGE="JavaScript">
<!--
if(!window.myButton)
myButton=new Object();
myButton.ImageZoomRunning = false;
myButton.zoomStretch = "BOTH";  //"HORIZONTAL", "VERTICAL"
myButton.zoomIn = function(img, zoomStep, maxZoom)
{
        if(img)
        {
                if(!zoomStep)
                {
                        if(myButton.zoomStretch == "VERTICAL")
                                zoomStep = img.height/10;
                        else
                                zoomStep = img.width/10;
                }
                if(!maxZoom)
                {
                        if(myButton.zoomStretch == "VERTICAL")
                                maxZoom = img.height/2;
                        else
                                maxZoom = img.width/2;
                }

                if(img.state == null)
                {
                        img.state = "OFF";
                        img.index = 0;
                        img.orgWidth =  img.width;
                        img.orgHeight = img.height;
                        img.zoomStep = zoomStep;
                        img.maxZoom  = maxZoom;
                }
                if(img.state == "OFF")
                {
                        img.state = "ZOOM_IN";
                        start_zooming();
                }
                else if( img.state == "ZOOM_IN_OUT"
                        || img.state == "ZOOM_OUT")
                {
                        img.state = "ZOOM_IN";
                }
        }
}
myButton.zoomOut = function(img)
{
        if(img)
        {
                if(img.state=="ON")
                {
                        img.state="ZOOM_OUT";
                        start_zooming();
                }
                else if(img.state == "ZOOM_IN")
                {
                        img.state="ZOOM_IN_OUT";
                }
        }
}
function start_zooming()
{
        if(!myButton.ImageZoomRunning)
                ImageZoomAnimation();
}
myButton.setZoom = function(img)
{
        if(myButton.zoomStretch == "HORIZONTAL")
        {
                img.width  = img.orgWidth  + img.index;
                img.height = img.orgHeight;
        }
        else if(myButton.zoomStretch == "VERTICAL")
        {
                img.width  = img.orgWidth;
                img.height = img.orgHeight + img.index;
        }
        else
        {
                img.width  = img.orgWidth  + img.index;
        }
}
function ImageZoomAnimation()
{
        myButton.ImageZoomRunning = false;
        for(i=0 ; i<document.images.length ; i++)
        {
                var img = document.images[i];
                if(img.state)
                {
                        if(img.state == "ZOOM_IN")
                        {
                                if(img.index < img.maxZoom)
                                        img.index+=img.zoomStep;
                                else
                                        img.index = img.maxZoom;
                                myButton.setZoom(img);
                                if(img.index == img.maxZoom)
                                        img.state="ON";
                                else
                                        myButton.ImageZoomRunning = true;
                        }
                        else if(img.state == "ZOOM_IN_OUT")
                        {
                                if(img.index < img.maxZoom)
                                        img.index+=img.zoomStep;
                                else
                                        img.index = img.maxZoom;
                                myButton.setZoom(img);
        
                                if(img.index == img.maxZoom)
                                        img.state="ZOOM_OUT";
                                myButton.ImageZoomRunning = true;
                        }
                        else if(img.state == "ZOOM_OUT")
                        {
                                if(img.index > 0)
                                        img.index-=img.zoomStep;
                                else
                                        img.index = 0;
                                myButton.setZoom(img);
                                if(img.index == 0)
                                        img.state="OFF";
                                else
                                        myButton.ImageZoomRunning = true;
                        }
                }
        }
        if(myButton.ImageZoomRunning)
                setTimeout("ImageZoomAnimation()", 40);
}
//-->
</SCRIPT>
<SCRIPT>
myButton.zoomStretch = "HORIZONTAL";
</script>
<!-------------- 여기까지 ---------------->
</head>
<body>
<!---- [2단계] BODY 부분에 아래와 같은 방법으로 태그와 코드를 복사 해 넣으세요 --->
<table align="center" width="180" cellspacing="0" cellpadding="0">
<tr>
<td align="center" width="300">
<A HREF="#"><img src="../230-33-1.gif" border="0"
                onMouseOver="myButton.zoomIn(this)" onMouseOut="myButton.zoomOut(this)"></a></td>
</tr>
<tr>
<td align="center" width="300">
<A HREF="#"><img src="../230-33-2.gif" border="0"
                onMouseOver="myButton.zoomIn(this)" onMouseOut="myButton.zoomOut(this)"></a></td>
</tr>
<tr>
<td align="center" width="300">
<A HREF="#"><img src="../230-33-3.gif" border="0"
                onMouseOver="myButton.zoomIn(this)" onMouseOut="myButton.zoomOut(this)"></a></td>
</tr>
<tr>
<td align="center" width="300">
<A HREF="#"><img src="../230-33-4.gif" border="0"
                onMouseOver="myButton.zoomIn(this)" onMouseOut="myButton.zoomOut(this)"></a></td>
</tr>
</table>
<!-------------- 여기까지 ---------------->
</body>
</html>

번호 제목 글쓴이
3421 심장 건강에 좋은 습관 8가지 [1] 뉴퐁
3420 잠잘 때 왼쪽으로 자면 생기는 신체 변화 7가지 [2] 뉴퐁
3419 스트레스를 줄이는 놀라운 방법 6가지 [2] 싹쓰리
3418 여성이 팬티에 대해 알아야 할 7가지 [3] 싹쓰리
3417 끓였던 물을 또 끓이면 안 되는 이유 [1] 싹쓰리
3416 "치주염 환자, 코로나 감염 땐 사이토카인 폭풍 가능성 높아" [1] 쌍둥이맘
3415 스마트스토어 상위 노출 꿀팁. 경쟁률 낮은 세부키워드 뽑는 방법 [2] 나혼자번다
3414 열감지 안면인식 출입관리솔루션 400만원짜리를 40만원에(정부지원사업) [1] file 나혼자번다
3413 전자렌지요리 만능 레시피 대공개!! [3] 나혼자번다
3412 식초로 집안을 반짝반짝하게!! 식초 청소법 [4] 쌍둥이맘
3411 마시고 남은 김빠진 맥주 활용법 [2] 쌍둥이맘
3410 계란을 먹은 후 절대 바로 먹으면 안되는 것들 쌍둥이맘
3409 아주 유용한 커피상식 쌍둥이맘
3408 간 건강과 지방간 완화에 아주 효과적인 채소는? [2] 싹쓰리
3407 골다공증 예방과 뼈에 아주 좋은 음식 8가지 싹쓰리
3406 체했을 때, 감기 걸렸을 때, 관절염 통증에는 이것이 최고!! 싹쓰리
3405 장을 편안하게 하면서 소화를 돕는 식품 5가지 [1] 싹쓰리
3404 초보운전자가 반드시 알아야 하는 고속도로 운전매너 5 [1] 싹쓰리
3403 머리카락이나 두피를 상하게 하는 사소한 습관 5 라이믹스
3402 어둡고 칙칙한 피부를 환하게 해주는 필수적인 습관 5 라이믹스
위로