473,385 Members | 1,486 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,385 software developers and data experts.

Show/Hide Layers

Can anyone help with this please?

This is a copy of my code.

Expand|Select|Wrap|Line Numbers
  1.  <td width="20%"><div id="Layer1">
  2.       <p onclick="MM_showHideLayers('Layer2','','show')">Raymond</p>
  3.       <p onclick="MM_showHideLayers('Layer2','','show')">Dave</p>
  4.       <p onclick="MM_showHideLayers('Layer3','','show')">Reggie</p>
  5.     </div> 
I'm trying to set up these layers so that when I click on Raymond, the associated layer appears and then when I click on Dave, the previous layer disappears and he layer associated with Dave appears. I can't figure out what I need to apply to get it to work.
Apr 3 '07 #1
2 3348
drhowarddrfine
7,435 Expert 4TB
This is javascript.
Apr 3 '07 #2
acoder
16,027 Expert Mod 8TB
Can anyone help with this please?

This is a copy of my code.

Expand|Select|Wrap|Line Numbers
  1.  <td width="20%"><div id="Layer1">
  2.       <p onclick="MM_showHideLayers('Layer2','','show')">Raymond</p>
  3.       <p onclick="MM_showHideLayers('Layer2','','show')">Dave</p>
  4.       <p onclick="MM_showHideLayers('Layer3','','show')">Reggie</p>
  5.     </div> 
I'm trying to set up these layers so that when I click on Raymond, the associated layer appears and then when I click on Dave, the previous layer disappears and he layer associated with Dave appears. I can't figure out what I need to apply to get it to work.
Are you sure Layer2 should appear twice?

Define a function which hides all, call that then call the show function, e.g.
Expand|Select|Wrap|Line Numbers
  1. function hideAll() {
  2.  for (i = 1; i <= 3; i++) {
  3.   document.getElementById('Layer'+i).style.visibility = 'hidden';
  4.  }
  5. }
  6.  
then
Expand|Select|Wrap|Line Numbers
  1. <p onclick="hideAll(); MM_showHideLayers('Layer2','','show');">Raymond</p>
Apr 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: David | last post by:
Hi everyone, Hoping there are some .js/browser experts out there that can help with this weird problem. I have made a swap div routine and applied the events to menu buttons with a closer...
2
by: geotso | last post by:
Hi I'm looking for a javascript with the following operation: if history.length <=2 show "layer1" and hide "layer2" else hide "layer1' and show "layer2"
2
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow {...
4
by: jerryyang_la1 | last post by:
I've found this script that allows be to hide/show form elements.. <script language="JavaScript"><!-- var toggle = true; function show(object) { if (document.layers && document.layers)...
3
by: Merlin | last post by:
Hi there, I am trying to create a form with an dynamic field that can be shown or hidden. As I saw for example on google it is possible with JS to show a layer and move the content underneath...
1
by: asilverpeach | last post by:
Hey Guys! Found some great scripts here on this topic but have to make to changes to the code that I can't seem to figure out. First, In the following code clicking on the headers shows the...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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...

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.