By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,693 Members | 1,803 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,693 IT Pros & Developers. It's quick & easy.

Changing menu image

P: n/a
Hi!
I'm trying to create a javaxcript application that changes a image menu
by following the mouse, something like:

<!-- menu images are m1, m2, m3.gif-->
<script language="JavaScript">
function option1()
{ document.getElementById("menu").write("<img src=m1.gif>"); }
function option2()
{ document.getElementById("menu").write("<img src=m2.gif>"); }
....</script>

<div id="menu">
<OBJECT data="m1.gif" type="image/gif" usemap="#map1" border=0>
<MAP name="map1">
<AREA HREF="#/" COORDS="0,0,50,14" onMouseOver="Option1()">
<AREA HREF="#/" COORDS="50,0,100,14" onMouseOver="Option2()">
....
</MAP></OBJECT>
</div>

I think you get the idea...
This seems very easy to do but it's not, believe me.
Any ideas? Thanks in advance!

Aug 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

<bz****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hi!
I'm trying to create a javaxcript application that changes a image menu
by following the mouse, something like:

<!-- menu images are m1, m2, m3.gif-->
<script language="JavaScript">
function option1()
{ document.getElementById("menu").write("<img src=m1.gif>"); }
function option2()
{ document.getElementById("menu").write("<img src=m2.gif>"); }
...</script>

<div id="menu">
<OBJECT data="m1.gif" type="image/gif" usemap="#map1" border=0>
<MAP name="map1">
<AREA HREF="#/" COORDS="0,0,50,14" onMouseOver="Option1()">
<AREA HREF="#/" COORDS="50,0,100,14" onMouseOver="Option2()">
...
</MAP></OBJECT>
</div>

I think you get the idea...
This seems very easy to do but it's not, believe me.
Any ideas? Thanks in advance!
Not sure what you're after exactly but at a guess i would think you need a
placeholder and change its href.

Aug 16 '05 #2

P: n/a

<bz****@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
Hi!
I'm trying to create a javaxcript application that changes a image menu
by following the mouse, something like:

<!-- menu images are m1, m2, m3.gif-->
<script language="JavaScript">
function option1()
{ document.getElementById("menu").write("<img src=m1.gif>"); }
function option2()
{ document.getElementById("menu").write("<img src=m2.gif>"); }
...</script>

<div id="menu">
<OBJECT data="m1.gif" type="image/gif" usemap="#map1" border=0>
<MAP name="map1">
<AREA HREF="#/" COORDS="0,0,50,14" onMouseOver="Option1()">
<AREA HREF="#/" COORDS="50,0,100,14" onMouseOver="Option2()">
...
</MAP></OBJECT>
</div>

I think you get the idea...
This seems very easy to do but it's not, believe me.
Any ideas? Thanks in advance!


This might help
http://forums.devshed.com/archive/t-120380
Aug 16 '05 #3

P: n/a
ASM
bz****@gmail.com wrote:
Hi!
I'm trying to create a javaxcript application that changes a image menu
by following the mouse, something like:

<!-- menu images are m1, m2, m3.gif-->
<script language="JavaScript">
function option1()
{ document.getElementById("menu").write("<img src=m1.gif>"); }
document.getElementById('menu').getElementsByTagNa me('OBJECT')[0].src='m1.gif';

but it is a bad idea as 'm1.gif' not yet downloaded on mouse over

about an alternative ?
change apparence of image by css preloading ?
http://perso.wanadoo.fr/stephane.mor..._etats_css.htm
http://perso.wanadoo.fr/stephane.mor..._etats_css.htm
with some words in french... but without them I think it's clear
<div id="menu">
<OBJECT data="m1.gif" type="image/gif" usemap="#map1" border=0>
<MAP name="map1">
<AREA HREF="#/" COORDS="0,0,50,14" onMouseOver="Option1()">
<AREA HREF="#/" COORDS="50,0,100,14" onMouseOver="Option2()">
...
</MAP></OBJECT>
</div>

--
Stephane Moriaux et son [moins] vieux Mac
Aug 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.