Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
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 April 9th, 2007, 11:48 AM
Friend of Wrox
 
Join Date: Oct 2004
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
 
Old April 10th, 2007, 05:05 AM
Friend of Wrox
 
Join Date: Nov 2005
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.
 
Old April 12th, 2007, 11:47 AM
Friend of Wrox
 
Join Date: Oct 2004
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
 
Old April 13th, 2007, 08:39 AM
Wrox Technical Editor
 
Join Date: Dec 2005
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]





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





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