Web/Javascript
이미지 페이드
aucd29
2013. 9. 26. 21:27
<script language="JavaScript" type="text/JavaScript">
/***************************************************************************
*
* Date : 2004-06-25
* Copyright : aucd29
* E-mail : aucd29@daum.net
* Type : function
*
* 이미지에 페이드 효과를 주기
*
***************************************************************************/
var opIndex=0;
var opCheck=false;
var opSpeed=5
function FadeLayer()
{
clearInterval(window.tm2);
if(opCheck==false)
{
opCheck = true;
window.tm=setInterval("FadeLayer2()",1);
}
}
function HideLayer()
{
clearInterval(window.tm);
if(opCheck==true)
{
opCheck=false;
window.tm2=setInterval("HideLayer2()",1);
}
}
function FadeLayer2()
{
if(opIndex<100)
{
opIndex+=opSpeed;
document.all('fade').style.filter='alpha(opacity:' + opIndex + ')';
}
else
{
clearInterval(window.tm);
return;
}
}
function HideLayer2()
{
if(opIndex>=0)
{
opIndex-=opSpeed;
document.all('fade').style.filter='alpha(opacity:' + opIndex + ')';
}
else
{
clearInterval(window.tm2);
return
}
}
</script>
<div align='center' id='fade' style="filter:Alpha(Opacity=0);position : absolute;" class='shadow3'><img src="img/s5_map2.gif" width="580" onMouseOver='FadeLayer()' onMouseOut='HideLayer()' height="423"></div>
/***************************************************************************
*
* Date : 2004-06-25
* Copyright : aucd29
* E-mail : aucd29@daum.net
* Type : function
*
* 이미지에 페이드 효과를 주기
*
***************************************************************************/
var opIndex=0;
var opCheck=false;
var opSpeed=5
function FadeLayer()
{
clearInterval(window.tm2);
if(opCheck==false)
{
opCheck = true;
window.tm=setInterval("FadeLayer2()",1);
}
}
function HideLayer()
{
clearInterval(window.tm);
if(opCheck==true)
{
opCheck=false;
window.tm2=setInterval("HideLayer2()",1);
}
}
function FadeLayer2()
{
if(opIndex<100)
{
opIndex+=opSpeed;
document.all('fade').style.filter='alpha(opacity:' + opIndex + ')';
}
else
{
clearInterval(window.tm);
return;
}
}
function HideLayer2()
{
if(opIndex>=0)
{
opIndex-=opSpeed;
document.all('fade').style.filter='alpha(opacity:' + opIndex + ')';
}
else
{
clearInterval(window.tm2);
return
}
}
</script>
<div align='center' id='fade' style="filter:Alpha(Opacity=0);position : absolute;" class='shadow3'><img src="img/s5_map2.gif" width="580" onMouseOver='FadeLayer()' onMouseOut='HideLayer()' height="423"></div>