메뉴 건너뛰기

전국분동대여

일반 자료실

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

 

하나의 이미지로 롤오버 효과를 느끼게 할 수 있는 스크립트 입니다
<!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>

번호 제목 글쓴이
259 로딩바 만들기 GACHIMOA
258 로테이트 되는 텍스트 배너 만들기 GACHIMOA
257 glow 필터를 이용한 텍스트 글로우 효과 GACHIMOA
256 writingMode 의 스타일을 사용하여 텍스트를 가로 혹은 세로로 보여줍니다 GACHIMOA
255 메세지들을 타이핑하듯 멋지게 애니메이션 시킨 후 다른 페이지로 이동시킵니다 GACHIMOA
254 여러군데 흩어졌다가 차례대로 정열되는 텍스트 메세지들 GACHIMOA
253 예쁘게 스크롤 되는 풍선 도움말(툴팁) 스크립트 GACHIMOA
252 마우스를 대면 메뉴 텍스트가 선명해 집니다 GACHIMOA
251 인트로 페이지에 사용하면 좋은 텍스트 스크롤 효과 GACHIMOA
250 3가지 색상을 지정할 수 있는 네온텍스트 스크롤 효과 GACHIMOA
249 메뉴항목에 마우스를 대면 체크박스에 체크됩니다 GACHIMOA
248 글자에 네온효과를 주며 덮어 씁니다 GACHIMOA
247 문장을 거꾸로 보여줍니다 GACHIMOA
246 점점 커지는 언덕모양을 보여주는 텍스트 스크립트 입니다 GACHIMOA
245 텍스트 인삿말이 왼쪽에서 날아와 안착합니다 GACHIMOA
244 링크 텍스트에 부드럽게 바뀌는 롤오버 텍스트 효과를 보여줍니다 GACHIMOA
243 링크 텍스트에 마우스를 대면 페이드 효과를 보여줍니다 GACHIMOA
» 이미지 버튼에 마우스를 대면 커지는 효과를 보여줍니다 GACHIMOA
241 텍스트의 테두리가 반짝입니다 GACHIMOA
240 테이블에도 롤오버 효과를 줍니다 GACHIMOA
위로