자바스크립트2008. 10. 11. 22:58
<!--StartFragment-->// 이미지 토글
<script>
function gogo(obj,opt)
{
var surl = 'http://' + document.location['host'];
obj.src = (obj.src == surl + '/images/img'+opt+'_on.gif') ? surl + '/images/img'+opt+'_off.gif': surl + '/images/img'+opt+'_on.gif';
}
</script>
<img src=images/img1_on.gif onclick=gogo(this,1)>
<img src=images/img2_on.gif onclick=gogo(this,2)>
<img src=images/img2_on.gif onclick=gogo(this,3)>
<img src=images/img2_on.gif onclick=gogo(this,4)>
<img src=images/img2_on.gif onclick=gogo(this,5)>

Posted by 아마데우스