Solved

DHTML menu over dropdown list box

Posted on 2004-09-16
11
6,811 Views
Last Modified: 2007-12-19
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?.
0
Comment
Question by:smrlnarisetty
11 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12080091
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&
0
 
LVL 6

Expert Comment

by:viola123
ID: 12080472
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
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12080525
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&

0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 6

Expert Comment

by:viola123
ID: 12080681
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

0
 
LVL 6

Expert Comment

by:viola123
ID: 12080712
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
0
 
LVL 3

Expert Comment

by:ragerino
ID: 12081885
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
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12091656
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&
0
 

Expert Comment

by:yingtuo
ID: 12099450
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

0
 

Author Comment

by:smrlnarisetty
ID: 12114065
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.
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12155620
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Html form and modal / img src -problem 3 30
Google Analytics setup 5 50
function parameter and using that as array 15 23
Fix Form size HTML 16 13
In this article, we'll look how to sort an Array in JavaScript, including the more advanced techniques of sorting a collection of records either ascending or descending on two or more fields. Basic Sorting of Arrays First, let's look at the …
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question