Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 6th, 2004, 11:22 PM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default Popup menus over <select> boxes

He everyone,

Ive had this problem whichs has been bugging me for ages, but i have always let it slide.

When i use popup menus and have a form on the page the select box is always displays above my popup menu which recks the popup.

How can i set the select box to be displayed below the popup menu?

Thanks in advance

Tim

TDA
__________________
TDA
 
Old July 7th, 2004, 12:49 AM
Friend of Wrox
 
Join Date: Jun 2004
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Sorry I dont think so that there is any methode to avoid this action

Love 4 all
 
Old July 7th, 2004, 02:42 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Tim,

This problem is caused by the fact that the drop-down is a Windowed control and manages its own z-index. So, even if the z-index of the drop-down is lower than that of the menu, you would still see the drop-down.
Sites like Yahoo Mail worked around this issue by hiding the drop-downs when the menu is open.
A completely different approach can be found here: http://dotnetjunkies.com/WebLog/jkin...07/21/488.aspx
Basically, it inserts an iframe in the page between the menu and the drop-down.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Venus by Air (Track 1 from the album: Talkie Walkie) What's This?
 
Old July 7th, 2004, 08:41 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I would go with the Yahoo! method. It could be as easy as adding one line of code to your popup menu functions (if they're written with JavaScript):

document.forms.form_name.select_name.display='none ';

HTH,

Snib

<><
 
Old July 7th, 2004, 05:16 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

document.forms.form_name.select_name.style.display='none';

Regards,
Rich

::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
 
Old July 7th, 2004, 05:24 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Quote:
quote:document.forms.form_name.select_name.display ='none';
>
Quote:
quote:document.forms.form_id.select_id.style.display='none';
Oops, sorry about that.

Also, it's not the name of the form/select you want, it's the ID.

Snib

<><
 
Old July 7th, 2004, 06:30 PM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default

Thanks everyone,

I used the Yahoo method. It was quick and easy to apply. And finally solved this anoying problem.

Thanks again

Tim :D

TDA





Similar Threads
Thread Thread Starter Forum Replies Last Post
<select> </select> prabhash_singh11 PHP How-To 2 March 11th, 2008 09:08 AM
How To PopUp Text Message within <li> tclotworthy Javascript How-To 1 February 18th, 2007 09:07 PM
select="<b>" AlDugan XSLT 8 March 24th, 2006 02:01 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
HELP: XSL -> HTML <select selected=true> jedbartlett XSLT 4 October 7th, 2004 11:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.