/    Sign up×
Community /Pin to ProfileBookmark

changing an image-map image

Hi, I tried getting some suggestions from this in the html section but no luck. i’m guessing its more complex than i thought, so hopefully javascript is the answer.

i have 3 images of the same size to be used as a toolbar/image-map.

i have the first image written as an image map to open htm files in an iframe window. however when the page opens i would also like the imagemap png to change aswell.

so that when someone clicks on the “i like” hotspot of “buttons.png” not only does it open “ilike.htm” in the iframe but the buttons.png is replaced with “ilike.png” with the same hotspots. when someone clicks the “to do” hotspot, todo.htm is loaded in the iframe and ilike.png or buttons.png is replaced with todo.png… etc…

here is what i have so far… it works aside from the toolbar image changing.
can anybody please help? (hopefully i was clear enough in explaining my situation/problem)

[CODE]
<html>
<body>
<P>
<center>
<table width=”272″ height=”130″ border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td colspan=”3″ height=”61″><img src=”top.png”></td></tr>
<tr>
<td colspan=”3″ height=”31″><img src=”buttons.png” border=”0″ usemap=”#Map”></td>
</tr>
<tr>
<td height=”281″ width=”28″><img src=”left.png”></td>
<td width=”220″ height=”281″ align=”left” valign=”top”><IFRAME SRC=”blank.htm” FRAMEBORDER=”0″ HEIGHT=”281″ WIDTH=”220″ NAME=”window” NORESIZE SCROLLING=”AUTO”></IFRAME></td>
<td height=”281″ width=”24″><img src=”right.png”></td>
</tr>
<tr>
<td colspan=”3″ height=”27″><img src=”bottom.png”></td>

</tr>
</table>
<P>
</center>
<map name=”Map”>
<area shape=”rect” coords=”21,10,97,30″ href=”ilike.htm” target=”window”>
<area shape=”rect” coords=”99,10,171,30″ href=”todo.htm” target=”window”>
<area shape=”rect” coords=”173,10,247,30″ href=”recipes.htm” target=”window”>
</map>
</body>
</html>

[/CODE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangFeb 06.2006 — Change these:&lt;img name="imagemap" src="buttons.png" border="0" usemap="#Map"&gt;
.
.
&lt;area shape="rect" coords="21,10,97,30" href="ilike.htm" onclick="document.imagemap.src='anotherImage.png';" target="window"&gt;


btw it's not a good idea to call your iframe name "window". It could be confused with the object of the same name.
×

Success!

Help @tbone spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...