Wrox Programmer Forums
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning 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 June 4th, 2003, 04:44 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using div for menu in Netscape 6

I am using the following function to hide a menu which works fine in
everything except NN 6 - the function hides the div on rolling out of the
text in the layer not the whole div itself. I used some code (borrowed from your book) to get around the problem in IE but cannot find equivilent code
for NN 6. Can anyone help? Regards. Incidentally I am using a NN 4 style
layer nested within a div to provide a MouseOut event for NN 4 could this
have any effect?

function hideMenu()
{
if (document.all)
 {
 if (event.toElement != HomeMenu && HomeMenu.contains(event.toElement) ==
false)
  {
   document.all.HomeMenu.style.visibility="hidden";
  }
 }
else if (document.layers)
 {
 document.HomeMenu.visibility="hidden";
 }
else if (!document.all && document.getElementById)
 {
     document.getElementById("HomeMenu").style.visibili ty="hidden";
    }

}
 
Old July 20th, 2004, 03:23 PM
Authorized User
 
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I wouldn't put too much focus on document.all this is an IE4 method, which will still work in IE5 as it is backwards compatable.
For IE5, NS6 and all DOM compliant browsers the correct method is document.getElementById?1:0;.

Use: this.dom=document.getElementById?1:0; as your priority. IE5 & NS6.
Use: this.ns4=(document.layers && !this.dom)?1:0; as NS4.
And use: this.ie4=(document.all && !this.dom)?1:0; as IE4

Hope this helps!






Similar Threads
Thread Thread Starter Forum Replies Last Post
CH 15 Context Menu - Element Menu Items Razzy The Pug BOOK: Ivor Horton's Beginning Visual C++ 2005 2 November 9th, 2008 03:53 PM
div within a div and inherting the height brettdavis4 CSS Cascading Style Sheets 1 January 23rd, 2007 09:59 AM
redirect netscape 4.7 to netscape 7.1 trangd Beginning PHP 10 January 15th, 2004 04:30 PM
Netscape div rollout problem chrisk Javascript How-To 2 June 17th, 2003 05:11 AM
Netscape div rollout problem chrisk Javascript 2 June 5th, 2003 07:58 AM





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