Replace Image of a Different Size

[Total: 0    Average: 0/5]

This loads a new image of a different size and sets the size correctly for the replacement image.

Body Code:

var _i = new Image(100,50); _i.src="";
var _j = new Image(50,50); _j.src="";
var Toggle = true;
function si(_v) 
  if (_v) document.images[0].src=_i.src;
  else document.images[0].src=_j.src;

<table border=1 height=300 width=300>
<tr height=100% width=100%>
<td width=100% height=100% align=center valign=middle>
<a href="javascript:si(Toggle)"><img src="" name=pic1></a>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *