Sorry for the typo in step 4: It is View>Toolbars>DHTML Effect
Main Topics
Browse All TopicsHi there,
I would like the following.
On my webpage I have serveral buttons. And I have one big Image in the middle of the page.
Dependent on the button where the mouse is over a different image must be displayed.
How can I accomplish this?
Please supply me with working code.
Thanks Stef
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
The above will swap the button with the image that you selected.
If you want to display the image in the centre not instead of the button, you will have to create layers.
When you take the mouse over a button the layer will be displayed in the middle of the page.
I can give you a sample that you can use if you give me how many buttons you are talking about and.
It will be perfect if you can give me the names of the buttons and the names of the pictures associated.
Regards
hhammash
Hi,
Copy this code into NotePad, then save the document as Layer.htm then view it in your browser.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(p
document.MM_pgW=innerWidth
else if (innerWidth!=document.MM_p
}
MM_reloadPage(true);
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&p
d=parent.frames[n.substrin
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;
for(i=0;!x&&d.layers&&i<d.
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHide
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))
if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v
obj.visibility=v; }
}
//-->
</script>
</head>
<body onLoad="MM_showHideLayers(
<div id="Image" style="position:absolute; left:232px; top:49px; width:255px; height:206px; z-index:1"><img src="../My%20Documents/My%
<img src="../My%20Documents/My%
</body>
</html>
This is a cample of what I am talking about.
hhammash
Hi,
thanks hhammash for the great tip above. I just tried using this code to implement the mouse over effect. I have about 10 buttons, and as I mouse-over each button, a different image does appear beautifully in the center of the page. I just have one problem. When the page loaded for the first time (using IE), all of the center images appeared briefly, layered one on top of the other, before the code:
onload="MM_showHideLayers(
seemed to execute for each image. I ended up with the image I wanted on the screen, but having all 10 images load and then disappear is something I want to avoid.
To resolve this, I tried writing a function that would specifically hide each image, and just show the one image I want at page load. Now, however, I'm getting no center image at all on page load. I'm a bit new to java script, so I'm hopeful that I just have a very minor error. Can you help?
To summarize, I just want to ensure that only one center image will appear at the time of the initial page load, and the images that correspond to each button will only be seen when the mouse is moved over the correct button.
function LL_pageLoad() {
MM_showHideLayers('Image',
MM_showHideLayers('Image2'
MM_showHideLayers('Image3'
MM_showHideLayers('Image4'
MM_showHideLayers('Image5'
MM_showHideLayers('Image6'
MM_showHideLayers('Image7'
MM_showHideLayers('Image8'
MM_showHideLayers('Image9'
MM_showHideLayers('Image10
MM_showHideLayers('Image1'
}
//-->
</script>
</head>
<body background="images/backgro
onLoad="LL_pageLoad" link="#3A0B1B" alink="#C0C0C0" >
.
.
.
<div id="Image" style="position:absolute; left:300px; top:200px; width:255px; height:206px; z-index:1">
<img src="images/musicinthepark
.
.
.
<a href="concert.htm">
<img border="0" src="images/button_concert
</a>
Thanks in advance for any help you are able to give,
nowickil
To see what I mean, you can also visit www.lwmusic.org
thanks,
nowickil
Business Accounts
Answer for Membership
by: hhammashPosted on 2004-10-06 at 04:17:07ID: 12236271
Hi,
You need image swapping. It is very easy. I guess that your buttons are images.
1- Keep a default image that will always be displayed when no button has the mouse over
2- Save the images that you want to display in "images" folder
3- Click once on the button, then select
4- View>Toolbards > DHTML Effect
5- in the "ON" pull down select MouseOver
6- In the "Apply" pull down select Swap Picture
7- In the last pull down select choose picture, then browse to the desired picture
Repeat this procedure for all buttons, then save the page.
Note that all images should have the same size as the big picture in the middle.
Regards
hhammash