웹마스터 팁

원래 제로PHP 메뉴에 있던건데.. 제가 조금 고쳤습니다..^^;

<html>
<head>
<script language="JavaScript">
<!-- 사용할 이미지를 생성하는 부분입니다. 버튼1 버든2라는 이미지 객체를 생성한다음 각각의 객체에 이미지 파일명을 넣습니다.. -->
BUTTON_1 = new Image();   <!--원래이미지 -->
BUTTON_2 = new Image();   <!-- 바뀔이미지 -->
BUTTON_1.src= = image_1.gif;
BUTTON_2.src= = image_2.gif;

<!-- 브라우저 종류,버전을 체크하는 부분-->
function BrowserCheck() {
        var b = navigator.appName
        if (b=="Netscape") this.b = "ns"
        else if (b=="Microsoft Internet Explorer") this.b = "ie"
        else this.b = b
        this.version = navigator.appVersion
        this.v = parseInt(this.version)
        this.ns = (this.b=="ns" && this.v>=4)
        this.ns4 = (this.b=="ns" && this.v==4)
        this.ns5 = (this.b=="ns" && this.v==5)
        this.ie = (this.b=="ie" && this.v>=4)
        this.ie4 = (this.version.indexOf('MSIE 4')>0)
        this.ie5 = (this.version.indexOf('MSIE 5')>0)
        this.min = (this.ns||this.ie)
}
is = new BrowserCheck()

<!-- 이미지를 바꾸는 부분-->
function chng(ImgName,ImgSrc){
        if ((screen.colorDepth >= 24) && (is.ie4)){eval('document.images.'+ImgName+'.src = '+ImgSrc+'.src;');}
        else{
                        eval(ImgName + '.filters.blendTrans.stop();');
                        eval(ImgName + '.filters.blendTrans.Apply();');
                        eval(ImgName + '.src=' + ImgSrc + '.src;');
                        eval(ImgName + '.filters.blendTrans.Play();');
        }
}

<!-- 이미지를 바꾸는 부분-->
function chng2(ImgName,ImgSrc){eval('document.images.'+ImgName+'.src = '+ImgSrc+'.src;');}

//-->
</script>
</head>

<body>
<table border=0 cellspacing=0 cellpadding=0 width=100%>
<tr>
<td valign=top>
        <a href=# onfocus='this.blur()' onMouseOver="chng('IMAGE_ID','BUTTON_1')" onMouseOut="chng('IMAGE_ID','BUTTON_2')">
                <img ID=IMAGE_ID src=1.gif border=0 style="filter:blendTrans(duration=0.5)">
        </a>
</td>
</tr>
</table>
</body>
</html>

좀 어렵다..^^ 잘 보세요..^^ 우선 맨 위에서 사용할 이미지를 선언하는데.. 1메뉴당 이미지가 2개 필요하니까 그럼 우선 각각의 이미지 객체를 만들고 파일명 넣고 위에 처럼요..
그리고 아래에서 링크걸때는 onmouseover="chng('위에서생성한이미지객체이름','이미지가들어갈img태그의 아이디')" 이런식으로 호출하시면 됩니다.. 온마우스아웃도 마찬가지로..^^ 제가 봐도 넘 복잡하네요..
제목 글쓴이 날짜
qmail-1.03설치④ (vpopmail 인증모듈) 비츠로 2003.02.28
qmail-1.03설치③ (qmail설치) 비츠로 2003.02.28
qmail-1.03설치② (checkpassword 인증모듈) 비츠로 2003.02.28
qmail-1.03설치① (ucspi-tcp모듈) 비츠로 2003.02.28
phpMyAdmin 보안설정하기 [5] 겨울늑대 2003.02.27
아파치에서 펄 CGI를 쓰려면... [3] okw1003 2003.02.23
php-accelerator <- zend보다 빠른 phpcache [6] 푸른하늘 2003.02.20
잘못풀린 Tar 파일이나 기타 패키지파일 지우기 Dopesoul 2003.02.19
리눅스에서 표준출력으로 출력되는 모든 메시지를 파일로 만들기 [1] Dopesoul 2003.02.19
램디스크 활용 [6] Dopesoul 2003.02.14
레드햇 8.0 에 젠드옵티마이져(Zend optimizer) 2.1.0 설치-왕초보용 [7] 정인배 2003.02.13
MySQL 3.23.53a 이하 패치하세요!! [7] 바른생활 NGEO 2003.02.11
새로운 방식의 APM 컴파일법 [13] Dopesoul 2003.02.07
[JSP설치2탄]mod_jk를 이용한 Apache와 Tomcat의 연동[for Windows98/NT/2000] [1] 한희진 2003.02.06
[JSP설치1탄]Windows에서 APM+Tomcat4.1.x버전 연동하기 (for Windows2000,XP) 한희진 2003.02.06
[성공했음]Apache에서 ASP돌리기 (Apache::ASP이용) for Windows 초고속강좌 [9] 한희진 2003.02.05
[간단한팁]아파치에서 ASP사용하기 [5] 한희진 2003.02.04
[mysql]정말 간단한 사용자 계정 주기 [1] 화니 2003.02.04
ls 명령어 팁... [3] -zenple_nux 2003.01.26
htaccss를 활용하자! 4탄 ForceType 사용하기. [1] 앳플군 2003.01.24