Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 4th, 2003, 04:44 AM
Registered User
 
Join Date: Jun 2003
Location: , , .
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";
    }

}
Reply With Quote
  #2 (permalink)  
Old July 20th, 2004, 03:23 PM
Authorized User
 
Join Date: Jul 2004
Location: , , .
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!

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 01:57 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.