Link to home
Start Free TrialLog in
Avatar of smrlnarisetty
smrlnarisetty

asked on

DHTML menu over dropdown list box

Hi,

My name is Rama and want help on DHTML menu.

I am using Top Navigational Bar II All  from
http://www.dynamicdrive.com/dynamicindex1/index.html.

All is working fine, But  my problem is,

I have couples of text boxes and drop down list boxes on the form already. When I pull the menu down the text boxes are hidden automatically, but, the drop down list boxes are still visible through the menu and it looks ugly. How do I hide drop down boxes whenever menu pulls down?. Hope I put it correctly?.
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

The selects have a z-index of infinity and awill always be on top.  The best work around is to put the selects in a layer and hide the layer when you display the menu:

<div id="thediv">
<select>
your options
</select>
</div>

Then in the script where you display the menu add:

document.getElementById('thediv').style.visibility='hidden';

When you close menu re-display the selects with:
document.getElementById('thediv').style.visibility='visible';

Cd&
Avatar of viola123
viola123

I got the same problem.  COBOLdinosaur indeed provided a solution.

however, another problem is that the dropdown box needs to be hidden only if a menu option is on top of it.

if the menu option is not on top of the dropdown box, is it ridiculous to hide the dropdown box??

so, who has any idea to refine this solution?? the thing is how to hide the dropdown box at the right time.

regards
viola
viola123,

If you have a question, then open a new thread.  That may or may not be an issue in this thread and I consider it quite rude that you come into someone else's question and try and direct it to solve your problem.

Cd&

sorry COBOLdinosaur if you think it is rude.

but i must say i never try to direct this thread to solve my problem. actually, smrlnarisetty mentioned he/she got this problem in a menu. that's why i think you solution could need to be refined to fit his/her case. obviously, your solution is suitable for a dropdown box/menu option at a static position and we all know the position of a  menu option could be dynamical.


i do apologize if you think i offended you and i never say you are 'ridiculous'. i mean the problem is 'ridiculous'.

it is indeed unfair to ask you to answer two question with points for only one thread. but that's not what i wanted to do.

i just want to join a discussion and bring forward my concern. if you think i delayed your progress to collect points, i quit and apologize again.

best regards
viola

hi,  smrlnarisetty:

sorry to join your thread. i just want to tell your i tried COBOLdinosaur's solution in my menu yesterday and found it could need to be refined to fit a dynamical database-driven menu. i am still working on my menu.

that's all i wanted to do. COBOLdinosaur probably misunderstand me.
we are all here to discuss tech issues, not anything else.

regards
viola
there are 2 possible solutions:
hide the select-elements when showing your menu or use a iframe inside the div.

as far as i know the select-elements only in IE shine through div's.

here's a good link which should be the solution.
http://dotnetjunkies.com/WebLog/jking/archive/2003/07/21/488.aspx
Hmmm, no response.  IF the possitioning as issue, then nothing relevant can be posted without knowning which which script is being used.  What we have here is a failure to communicate.

 smrlnarisetty,

This is not a news group where you post and come back some weeks later to find a solution posted.  If you fail to participate, we lose interest; and you won't get much detailed help.  

Cd&
come on, COBOLdinosaur, it's you again.

i understand you are eager to grab this 500 points. but please be polite to others again.

you cannot always say some one is 'RUDE' just because he thinks your solution is not perfect. if the questioner finally thinks your solution is helpful, you can get points anyway.

alternatively, if you lose interest, please ignore this thread. nobody is supposed to give you points only 10 minutes after you answered a question.

again, be patient and polite to others all the time

yingtuo

Avatar of smrlnarisetty

ASKER

Hi All,

I found a solution:

function hideObjects()
{
      var selCount = document.all.tags("select");
      for (i=0; i<selCount.length; i++)
            selCount[i].style.visibility = "hidden";

}

function showObjects() {
 selCount=document.all.tags("select")
      for (i=0;i<selCount.length;i++)
            selCount[i].style.visibility="visible"
}

And I am calling  these functions whenever I require them.
ASKER CERTIFIED SOLUTION
Avatar of ee_ai_construct
ee_ai_construct
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial