Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 April 9th, 2007, 11:48 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default Positioning Problem in Firefox and Netscape

Hi Everyone,

I'm struggling with a problem and was wondering if anyone had any suggestions on how best for me to narrow it down.

Basically I have been tweaking a javascript menu, where the submenus slide out from the right hand side of the menu. It works fine in Opera and IE, however I am having a problem in with Netscape and FireFox.

What the code is doing, is determining where the submenu should appear, and then setting the top & left style elements to these values. The problem is in FireFox and Netscape, the menu is appearing in the top/left corner of the page, and any further sub-menus and appearing below this, instead of out to the side.

position is set to absolute if that helps, and the values in the top and left properties are correct after the calculation. I suspect that it may have to do with the positioning.

Any suggestions would be greatly appreciated.

Thanks

Mike

Mike
EchoVue.com
__________________
Mike
EchoVue.com
Reply With Quote
  #2 (permalink)  
Old April 10th, 2007, 05:05 AM
Friend of Wrox
 
Join Date: Nov 2005
Location: Rotterdam, , Netherlands.
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Most javascript menus have CSS to style the menu. Things you could try are to put the position to relative
Code:
menu{
  position:relative;
}
if that doesn't work you can try to experiment with !important in your CSS.
Code:
menu{
width:300px!important;/*Only firefox will use this*/
width:100px;/*This will apply for IE*/
}
I am not sure of the same effect will work on Netscape but i think Netscape and Firefox behave the same.

__________________________________________________ ________
I am DJ Kat...that's my name. Its a D and a J and a Kat with a K.
Reply With Quote
  #3 (permalink)  
Old April 12th, 2007, 11:47 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: Clinton, UT, USA.
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Thanks DJ Kat,

I'll have to experiment with the !important thing.

It turns out that Netscape and Firefox both treat div's and other elements differently when they are not visible... The div I was trying to position was taking it's top and left from another, but because the other was not yet visible, it took it's top and left values as zero. Very confusing, but what I had to do to fix it, was make the div visible before it popped out.

Thanks again, for the advise,

Mike

Mike
EchoVue.com
Reply With Quote
  #4 (permalink)  
Old April 13th, 2007, 08:39 AM
Wrox Technical Editor
 
Join Date: Dec 2005
Location: , , Canada.
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Netscape 8+ uses the same rendering engine (Gecko) as Mozilla and Firefox.

Read more here: http://en.wikipedia.org/wiki/Netscap...based_releases

- Adam Kahtava [http://adam.kahtava.com]
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
relative positioning in Firefox mackknife BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 July 12th, 2007 02:02 AM
positioning text + form element + firefox Adam H-W CSS Cascading Style Sheets 2 June 12th, 2007 03:18 AM
Error with Netscape and FireFox echovue Ajax 1 April 18th, 2007 08:27 AM
Trouble rendering form in firefox and netscape vic02 ASP.NET 2.0 Professional 0 March 21st, 2006 01:46 PM
Positioning Problem harpua CSS Cascading Style Sheets 5 May 27th, 2005 08:03 AM



All times are GMT -4. The time now is 10:35 PM.


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