[javascript] OnMouseDown으로 이미지 변경 예제
로빈아빠
본문
^ㅡ^ 응용 해서 사용...
<STYLE>image { border:0; }</STYLE>
<BODY>
<DIV style="color:teal">Mouse를 누르고 있으면(OnMouseDown) 이미지가 바뀐다.
<DL>
<DT><A href="xmusdwn.html"
OnMouseDown="document.images['link1'].src='gif/ulayout1.gif'"
OnMouseUp="document.images['link1'].src='gif/ulayout.gif'"><IMG src="gif/ulayout.gif" name='link1'></A>
<DD><A href="xmusdwn.html"
OnMouseDown="document.images['link1'].src='gif/ulayout1.gif'"
OnMouseUp="document.images['link1'].src='gif/ulayout.gif'">onmousedown, onmouseup</A>
<DT><A href="xmusdwn.html"
OnMouseDown="document.images['link2'].src='gif/ucontact1.gif'"
OnMouseUp="document.images['link2'].src='gif/ucontact.gif'">
<IMG src="gif/ucontact.gif" name='link2'></A>
<DD><A href="xmusdwn.html"
OnMouseDown="document.images['link2'].src='gif/ucontact1.gif'"
OnMouseUp="document.images['link2'].src='gif/ucontact.gif'">onmousedown, onmouseup</A>
</DL>
<BR>
Mouse를 올려 놓으면 있으면(OnMouseDown) 이미지가 바뀜
<DL>
<DT><A href="xmusdwn.html"
onMouseOver="document.images['link3'].src='gif/ulayout1.gif'"
onMouseOut="document.images['link3'].src='gif/ulayout.gif'"><IMG src="gif/ulayout.gif" name='link3'></A>
<DD><A href="xmusdwn.html"
onMouseOver="document.images['link3'].src='gif/ulayout1.gif'"
onMouseOut="document.images['link3'].src='gif/ulayout.gif'">onmouseover, onmouseout</A>
<DT><A href="xmusdwn.html"
onMouseOver="document.images['link4'].src='gif/ucontact1.gif'"
onMouseOut="document.images['link4'].src='gif/ucontact.gif'">
<IMG src="gif/ucontact.gif" name='link4'></A>
<DD><A href="xmusdwn.html"
onMouseOver="document.images['link4'].src='gif/ucontact1.gif'"
onMouseOut="document.images['link4'].src='gif/ucontact.gif'">onmouseover, onmouseout</A>
</DL>
</DIV>
</BODY>
document.images['link1'].src='gif/ulayout1.gif'로 이미지을 표현한다. 이때 link1은 이미지 name 임
[이 게시물은 VIRHAC님에 의해 2009-09-13 14:33:19 HTML에서 이동 됨]
<STYLE>image { border:0; }</STYLE>
<BODY>
<DIV style="color:teal">Mouse를 누르고 있으면(OnMouseDown) 이미지가 바뀐다.
<DL>
<DT><A href="xmusdwn.html"
OnMouseDown="document.images['link1'].src='gif/ulayout1.gif'"
OnMouseUp="document.images['link1'].src='gif/ulayout.gif'"><IMG src="gif/ulayout.gif" name='link1'></A>
<DD><A href="xmusdwn.html"
OnMouseDown="document.images['link1'].src='gif/ulayout1.gif'"
OnMouseUp="document.images['link1'].src='gif/ulayout.gif'">onmousedown, onmouseup</A>
<DT><A href="xmusdwn.html"
OnMouseDown="document.images['link2'].src='gif/ucontact1.gif'"
OnMouseUp="document.images['link2'].src='gif/ucontact.gif'">
<IMG src="gif/ucontact.gif" name='link2'></A>
<DD><A href="xmusdwn.html"
OnMouseDown="document.images['link2'].src='gif/ucontact1.gif'"
OnMouseUp="document.images['link2'].src='gif/ucontact.gif'">onmousedown, onmouseup</A>
</DL>
<BR>
Mouse를 올려 놓으면 있으면(OnMouseDown) 이미지가 바뀜
<DL>
<DT><A href="xmusdwn.html"
onMouseOver="document.images['link3'].src='gif/ulayout1.gif'"
onMouseOut="document.images['link3'].src='gif/ulayout.gif'"><IMG src="gif/ulayout.gif" name='link3'></A>
<DD><A href="xmusdwn.html"
onMouseOver="document.images['link3'].src='gif/ulayout1.gif'"
onMouseOut="document.images['link3'].src='gif/ulayout.gif'">onmouseover, onmouseout</A>
<DT><A href="xmusdwn.html"
onMouseOver="document.images['link4'].src='gif/ucontact1.gif'"
onMouseOut="document.images['link4'].src='gif/ucontact.gif'">
<IMG src="gif/ucontact.gif" name='link4'></A>
<DD><A href="xmusdwn.html"
onMouseOver="document.images['link4'].src='gif/ucontact1.gif'"
onMouseOut="document.images['link4'].src='gif/ucontact.gif'">onmouseover, onmouseout</A>
</DL>
</DIV>
</BODY>
document.images['link1'].src='gif/ulayout1.gif'로 이미지을 표현한다. 이때 link1은 이미지 name 임
[이 게시물은 VIRHAC님에 의해 2009-09-13 14:33:19 HTML에서 이동 됨]
관련링크
댓글목록
등록된 댓글이 없습니다.