Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript 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 November 21st, 2003, 12:17 PM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Javascript menus

I have got a javascript rollover menu. When the mouse rolls over it, a submenu appears. (Suprise!!!)

The trouble is, I have a select control below the menu, and when the submenu appears, it is hidden behind the select control.

I have heard that there is a way to get round this using Iframes and div tags. Does anyone know how to use these to stop the above from happening? Could someone almost explain this as I cannot find any clear examples of how this is done.

Sorry for being such a spanner, but this problem is driving me doooolally!!!


Cheers from
Al C
 
Old November 21st, 2003, 01:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, this is a real problem. Somehow, the drop down seems to have a "always on top" property (internally) that you can't change. I am sure it's a bug in the browser, but it seems it hasn't been fixed.

I recently saw that my mail box at Yahoo.com has a fix for it. Basically, they simply hide the offending drop downs when a menu opens. I assume they do that by setting the display to none, or the visibility to hidden, using CSS.

If you have a Yahoo account, simply look at the source to see how it's done.

If you can't find out how it works, let me know and I'll help you figure it out.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 21st, 2003, 02:08 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Explanation:

I did a little research on this topic (though never fixed our occurance of the problem, just worked around it). What I found explained that the <select> HTML control is a "windowed" control. What that means I don't really understand. But it has to do with the method by which the browser draws the object. This problem also exists with certain plugins like some media players. Media players often use directx type of drivers to draw the video to the screen. This involves a more direct relationship with the video adapter memory or the OS's video drivers. The plugin knows where the media "screen" is on the physical screen layout based on information from the browser about the control's position in the browser document window. It uses that and writes the video output to the video directly in the right position, thus circumventing the other objects in the browser. That's why you'd see a video player always on top and why sometimes the media display location lags behind page scrolling or can even get stuck if the player crash, leaving a black hole on the screen. Because the select boxes are "windowed", this is likely the same cause for them to appear that way.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 21st, 2003, 03:35 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Peter is right it's because they are windowed. Basically, you can't put a non-windowed control in front of a windowed control, because they are drawn in a different "pane", so to speak.

You can put non-windowed controls in front of other non-windowed controls because they're drawn in the same "pane", but the separate "pane" for windowed controls is always in front of the "pane" for non-windowed controls.

There's nothing you can do about it, you just have to hide the windowed control if you want the non-windowed object to appear.

rgds
Phil
 
Old November 21st, 2003, 05:26 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Right, I knew about the problem, but it's nice to see it has a name..... ;)

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old November 26th, 2003, 11:58 AM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

http://www.jguru.com/faq/view.jsp?EID=777765

guys (and girls!), refer to this link above. Are these people talking about the same problem? They seem to have managed to get around a very similar problem with ActiveX viewer control and asp menus. Unfortunately, since I have seen this site, it has changed, and now doesn't show the page with the solution on it... GRRRRR!!!

However, I live in hope that there is a solution involving a combination of iframes and div tags. Goodness knows what that is!

Cheers from
Al C





Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Menus Andrew_S ASP.NET 2.0 Basics 1 May 7th, 2006 12:58 PM
HTML menus BrendonMelville HTML Code Clinic 3 March 14th, 2006 10:51 AM
showing javascript context menus outside frames... jxn Javascript How-To 5 February 3rd, 2006 07:53 PM
sub menus matshediso HTML Code Clinic 2 January 31st, 2005 05:15 AM
Menus Frank Schmuck BOOK: Beginning ASP.NET 1.0 1 June 6th, 2003 01:29 PM





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