Hi all,
Im having some troubles with layers on a site im developing.
I have two layers one has an image of an artists palette on it and each blob
of paint is a link to a page on the site. That uses an image map and hrefs.
The second layer is where the page will appear. So when a user clicks a link
on the palette image, a new 'window' will appear over the palette to show
the content. The image of the palette will be slightly faded out to
highlight the content.
The trouble I'm having is switching between the layers when a link is
clicked. The image map links dont seem to show the content window or even be
clickable.
Im not sure if Im going about this the right way though because I also need
to be able to close the content window to show the menu again. If anyone has
any ideas on how to achieve this or any pointers then I would be happy to
know them coz I'm stumped.
The code for the page so far is below and the I know this code may seem a
bit of a mess but I've been trying everything so its a little un-organised.
I've used the z-Index
and visibility alone and together and no sucess so far.
If you need any further info then let me know.
Thanks in advance for your help
James
Scroll down for the code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Docume nt 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet " type="text/css" href="main.css"/ >
<script language="javas cript" type="text/javascript">
function openwindow(elm)
{
window.document .getElementById ("content").sty le.visibility=" hidden";
window.document .getElementById ("content").sty le.zIndex = "0";
window.document .getElementById ("palette").sty le.visibility=" hidden";
window.document .getElementById ("palette").sty le.zIndex = "0";
window.document .getElementById (elm).style.vis ibility="visibl e";
window.document .getElementById (elm).style.zIn dex = "100";
}
</script>
</head>
<body topmargin="0" marginwidth="0" marginheight="0 "
onLoad="javascr ipt:openwindow( 'palette')">
<table width="579" height="582" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>
<div id="palette" class="palette" name="palette" style="visibili ty:
hidden; z-Index: 0">
<img src="images/backgroundpalet te.png" border="0"
usemap="#palett eMap" start="fileopen " target="#frame" >
</div>
<div name="content" id="content" class="content" style="visibili ty:
hidden; z-Index: 0">
<iframe src="home.htm" frameborder="0" width="579" height="582"
allowtransparen cy="true"/>
</div>
</td>
</tr>
</table>
<map name="paletteMa p" id="paletteMap" >
<area shape="circle" coords="478,177 ,46" href="home.htm" target="#frame"
alt="Homepage" onClick="javasc ript:openwindow ('content')">
<area shape="circle" coords="183,281 ,50" href="gallery.h tm"
target="#frame" alt="Gallery" onClick="javasc ript:openwindow ('content')">
<area shape="circle" coords="311,489 ,49" href="links.htm " target="#frame"
alt="Links" onClick="javasc ript:openwindow ('content')">
<area shape="circle" coords="323,160 ,50" href="about.htm " target="#frame"
alt="About Me" onClick="javasc ript:openwindow ('content'))">
<area shape="circle" coords="150,389 ,49" href="events.ht m" target="#frame"
alt="Events" onClick="javasc ript:openwindow ('content')">
<area shape="circle" coords="184,502 ,56" href="contact.h tm"
target="#frame" alt="Contact Me" onClick="javasc ript:openwindow ('content')">
</map>
</body>
</html>