473,408 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Changing menu image

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
3 1525

<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

<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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Frostillicus | last post by:
Hi, I've written some javascript to randomly choose a classical music composer's picture and sample audio and display it on my home page (http://marc.fearby.com/), and this works fine in Mozilla...
3
by: Charlotte | last post by:
Hi there, does anyone know the HTML code or Java script for changing the website icon when other people add the link to their favourites menu?? Thanks~ Charlotte
0
by: beartrax | last post by:
I am using Windows Mobile 2003 SE and trying to change the menu selectable VIEW mode by using javascript or any other programming method within an html page. The menu view modes I would like to be...
1
by: sthrudel | last post by:
Hello! I'm programmatically inserting a navigation asp menu to a page, like this: // Create new Menu Menu menu = new Menu(); // Create new MenuItem MenuItem mainItem = new MenuItem();
0
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hello, I have a masterpage with a menu on it. Each menu item has a different image specified through the imageurl property. I have code that changes the menu item image when it is clicked...
1
by: Carl Gilbert | last post by:
Hi Could someone please advise on the best method to achieve the following. I want a flat menu which uses images rather than text for each menu item. All items will have the same image...
1
by: nt5515 | last post by:
hey Im trying to make a game of pairs (the memory game) i have set up a grid which displays a graphic for the card back. im trying to link the edit menu to choose the graphic to be displayed. i've...
2
by: paul | last post by:
I have a JS function to change the width of a <divthat works great in Firefox, but not at all in IE7. In IE an error message occurs: Line: 92 Char: 5 Error: Invalid Argument Code: 0 Firefox...
16
by: stevedude | last post by:
CSS newbie again. I have a problem trying to get coffee mug images within anchor tags to center with my link text for a vertical list menu. If I use the horizontal/vertical properties of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.