Paully1999
Programmer
Code below
I need to change the imagemap name that is used after a person clicks on the image.
I want to swap between image map1 and image map2
I am already swaping the image in the animate function.
But how...I don't have a clue.
So a little help please.
Paul
<SCRIPT>
var img0 = new Image( 640, 480 );
img0.src = "radimg6/<%=StateImageAni%>";
var img1 = new Image( 640, 480 );
img1.src = "radimg5/<%=StateImageAni%>";
var img2 = new Image( 640, 480 );
img2.src = "radimg4/<%=StateImageAni%>";
var img3 = new Image( 640, 480 );
img3.src = "radimg3/<%=StateImageAni%>";
var img4 = new Image( 640, 480 );
img4.src = "radimg2/<%=StateImageAni%>";
var img5 = new Image( 640, 480 );
img5.src = "radimg1/<%=StateImageAni%>";
var imgtb = new Image( 640, 22 );
imgtb.src = "/images/zoomout_stop_opt.gif";
var stopped = 1
var i = 0;
var nbImg = 6; // change to the number of different images you have
function animate() {
document.radar.src = eval("img" + i ).src;
i++;
if (i == nbImg) i=0;
junk = setTimeout("animate();", 500); // in milliseconds
document.tool2bar.src = imgtb.src;
return;
}
function stopit() {
clearTimeout(junk);
return;
}
</script>
<MAP NAME="map1" >
<AREA SHAPE="rect" ALT="" COORDS="0,0,187,22" HREF="/weather/radar.asp">
<AREA SHAPE="rect" ALT="" COORDS="249,0,396,22" HREF="javascript:animate();">
</MAP>
<MAP NAME="map2" >
<AREA SHAPE="rect" ALT="" COORDS="0,0,187,22" HREF="/weather/radar.asp">
<AREA SHAPE="rect" ALT="" COORDS="269,0,396,22" HREF="javascript:stopit();">
</MAP>
<img name="tool2bar" src="/images/zoomout_animate_opt.gif" usemap="#map1" border="0">
<IMG name="radar" src="theimage.gif" width=640 height=480 ALT="Click to change image">
I need to change the imagemap name that is used after a person clicks on the image.
I want to swap between image map1 and image map2
I am already swaping the image in the animate function.
But how...I don't have a clue.
So a little help please.
Paul
<SCRIPT>
var img0 = new Image( 640, 480 );
img0.src = "radimg6/<%=StateImageAni%>";
var img1 = new Image( 640, 480 );
img1.src = "radimg5/<%=StateImageAni%>";
var img2 = new Image( 640, 480 );
img2.src = "radimg4/<%=StateImageAni%>";
var img3 = new Image( 640, 480 );
img3.src = "radimg3/<%=StateImageAni%>";
var img4 = new Image( 640, 480 );
img4.src = "radimg2/<%=StateImageAni%>";
var img5 = new Image( 640, 480 );
img5.src = "radimg1/<%=StateImageAni%>";
var imgtb = new Image( 640, 22 );
imgtb.src = "/images/zoomout_stop_opt.gif";
var stopped = 1
var i = 0;
var nbImg = 6; // change to the number of different images you have
function animate() {
document.radar.src = eval("img" + i ).src;
i++;
if (i == nbImg) i=0;
junk = setTimeout("animate();", 500); // in milliseconds
document.tool2bar.src = imgtb.src;
return;
}
function stopit() {
clearTimeout(junk);
return;
}
</script>
<MAP NAME="map1" >
<AREA SHAPE="rect" ALT="" COORDS="0,0,187,22" HREF="/weather/radar.asp">
<AREA SHAPE="rect" ALT="" COORDS="249,0,396,22" HREF="javascript:animate();">
</MAP>
<MAP NAME="map2" >
<AREA SHAPE="rect" ALT="" COORDS="0,0,187,22" HREF="/weather/radar.asp">
<AREA SHAPE="rect" ALT="" COORDS="269,0,396,22" HREF="javascript:stopit();">
</MAP>
<img name="tool2bar" src="/images/zoomout_animate_opt.gif" usemap="#map1" border="0">
<IMG name="radar" src="theimage.gif" width=640 height=480 ALT="Click to change image">