473,800 Members | 2,711 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Div layer switching

JS
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>

Jan 11 '07 #1
2 2563

JS escreveu:
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>
Hi James,
Try this
<script type="text/javascript">
var events = {};
events.prototyp e = {
activeDiv:null,
toggle:function (div){
if(this.activeD iv != null){
document.getEle mentById(this.a ctiveDiv).style .display =
'none';
}
document.getEle mentById(div).s tyle.display='b lock';
}
}
</script>
In onclick event just tipe events.toggle(' myDivId').
<area shape="circle" coords="150,389 ,49" href="events.ht m"
target="#frame" alt="Events" onClick="events .toggle('myDivI d')">

Filipe Tomita

Jan 11 '07 #2
JS
Thanks Filipe but am I missing something because it still doesn't work. The
new code is below. If it cant be dont with divs is there another way maybe.
It needs to work in Firefox and IE 6+.
Many thanks all
James

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitl ed 1</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet " type="text/css" href="main.css"/ >
<script type="text/javascript">
var events = {};
events.prototyp e = {
activeDiv:null,
toggle:function (div){
if(this.activeD iv != null){
document.getEle mentById(this.a ctiveDiv).style .display =
'none';
}
document.getEle mentById(div).s tyle.display='b lock';
}
}
</script>

</head>

<body topmargin="0" marginwidth="0" marginheight="0 ">

<table width="579" height="582" border="0" cellpadding="0" cellspacing="0" >
<tr>
<td>
<div id="palette" class="palette" name="palette" style="display:
block;">
<img src="images/backgroundpalet te.png" border="0"
usemap="#palett eMap" start="fileopen " target="#frame" >
</div>
<div name="content" id="content" class="content" style="display:
none;">
<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="events .toggle('conten t')">
<area shape="circle" coords="183,281 ,50" href="gallery.h tm"
target="#frame" alt="Gallery" onClick="events .toggle('conten t')">
<area shape="circle" coords="311,489 ,49" href="links.htm " target="#frame"
alt="Links" onClick="javasc ript:events.tog gle('content')" >
<area shape="circle" coords="323,160 ,50" href="about.htm " target="#frame"
alt="About Me" onClick="events .toggle('conten t')">
<area shape="circle" coords="150,389 ,49" href="events.ht m" target="#frame"
alt="Events" onClick="events .toggle('conten t')">
<area shape="circle" coords="184,502 ,56" href="contact.h tm"
target="#frame" alt="Contact Me" onClick="events .toggle('conten t')">
</map>
</body>
</html>
--

"Filipe Tomita" <fi***********@ gmail.comwrote in message
news:11******** **************@ o58g2000hsb.goo glegroups.com.. .
>
JS escreveu:
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>
Hi James,
Try this
<script type="text/javascript">
var events = {};
events.prototyp e = {
activeDiv:null,
toggle:function (div){
if(this.activeD iv != null){
document.getEle mentById(this.a ctiveDiv).style .display =
'none';
}
document.getEle mentById(div).s tyle.display='b lock';
}
}
</script>
In onclick event just tipe events.toggle(' myDivId').
<area shape="circle" coords="150,389 ,49" href="events.ht m"
target="#frame" alt="Events" onClick="events .toggle('myDivI d')">

Filipe Tomita

Jan 12 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1941
by: PAD | last post by:
I have written a javascript routine that populates a parent document with a series of <iframe>s. Each <iframe> receives its contents from a series of separate smaller HTML files. Of course my NN 4.8 browser doesn't deal well with the <iframe> so I wrapped the code that generates the <iframe> in <ilayer> tags. NN now recognizes the contents. However within each of the 'content' files I have another javascript routine that basically...
87
9632
by: expertware | last post by:
Dear friends, My name is Pamela, I know little about CSS, but I would like to ask a question I have an image on a web page within a css layer: <DIV ID=MyLayer STYLE = "position: absolute;top:68px; left:563px; width:640px;height:480px;"> <IMG src="ReportImageBox_12.54.52.png" width=640 height=480></IMG>
2
2395
by: asad | last post by:
hello, how ru all pls tell me how can i create DAL and how can i use it in my ASP.NET pages thanks
1
1616
by: rbg | last post by:
Hi, I am trying to understand the layering concept with the ASP.NET 2.0 apps. I have a ASP.NET 2.0 Web app which has 3 layers Presentation layer which contains UI elements and Input validation logic
16
9038
by: MS newsgroup | last post by:
I don't have clear reasons why we need business logic layer and data logic layer instead of having only data logic layer. Are there any good reasons for that?
3
1654
by: Qingdong Z. | last post by:
I know this is a silly question, but I am looking for the best way. I build a windows application with standard version and enterprise version. Standard version use local SQL/Access as database. Enterprise version use Centralized Web Service as Database. Which is the easiest way to handle this? I have too many classes have data access. I can create following classes, How could I use Interface or other ways to call right DB? class1
2
1995
by: funkiejunkie | last post by:
Hello all, I posted a thread a while ago and was told to include the code so here it is. I still dont really get CSS, everything I have done has been blagged because I cant be bothered to read books to help me understand whats really going on. I would a few more containers within my centered text box in the middle so I dont have to press spacebar to get where I would like it, but have had trouble. I recon im doing a lot wrong so please...
8
4137
by: morleyc | last post by:
Hi, until recently i was quite happy to add data sources from mssql database in visual studio and drag the datasets directly onto the form this creating a directly editable form which worked well. However i have recently started a project which will require synchronization to a remote database. Also the underlying database provider may change at a later date. From what i have read it seems that a layered approach is necessary, or at...
8
2306
by: andre rodier | last post by:
Hello, As indicated in the title, I am looking for a PHP library able to create on the fly complex SQL requests, on 5 or 6 dimensions, without problems occurs on many-to-many relations, etc. Thanks
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10507
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10036
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7582
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6815
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5473
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4150
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.