터의 지난 게시판에 나온 자바스크립트 소스대로 이미지 변환을 시도했는데
문제가 발생하였습니다.
제가 한 소스는 아래와같습니다.
<script language="JavaScript">
{
t1off = new Image();
t1off.src = "../monica/image/off1.gif";
t1on = new Image();
t1on.src = "../monica/image/on1.gif";
t2off = new Image();
t2off.src = "../monica/image/off2.gif";
t2on = new Image();
t2on.src = "../monica/image/on2.gif";
.
.
. - 이렇게 6번까지 했구요..
}
function img_act(imgName)
{
imgOn = eval(imgName + "on.src");
document [imgName].src = imgOn;
}
function img_inact(imgName)
{
imgOff = eval(imgName + "off.src");
document [imgName].src = imgOff;
}
</script>
그리고 실제 이미지에는
<a href="frame.htm" target="_top"
onmouseover="img_act(’t1’); return true" onmouseout="img_inact(’t1’)">
<img src="../monica/image/off1.gif" width="55" height="20" border="0"
alt="공지사항" name="t1" target="_top"></a>
<a href="frame1.htm" target="_top"
onmouseover="img_act(’t2’);">
<img src="..monica/image/off2.gif" width="55" height="20" border="0"
alt="소개" name="t2" target="_top"></a>
.
.
.
이런식으로 역시 여섯개를 했습니다.
그런데 처음 창을 띄우면 이미지가 뜨질 않습니다.
마우스로 이미지가 놓일 자리를 한번 지나가야 보이기 시작합니다.
그 후에는 변환이 잘 되구요.
에러도 나지 않는데..
