Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Offset parent in IE6 (and maybe 7)
Old 03-23-2007, 03:02 PM Offset parent in IE6 (and maybe 7)
Super Talker

Posts: 116
Trades: 0
Hi all,

I'm trying to line up a subnav menu in JavaScript.

The code I'm using is:
Subnav9.style.left = obj.offsetParent.left;

This works under Opera & FireFox, but not under Internet Explorer. It pushes it off to the right.

I tried searching for bug fixes to IE but couldn't find any.

Any clues?

Thanks
DonnaZ
DonnaZ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-23-2007, 03:36 PM Re: Offset parent in IE6 (and maybe 7)
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Everything you wanted to know about bug-fixing in IE:
http://www.positioniseverything.net/explorer.html

What other styles are applied besides the offset ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-23-2007, 06:12 PM Re: Offset parent in IE6 (and maybe 7)
Super Talker

Posts: 116
Trades: 0
I inherited this site that was programmed like 2 years ago (you can see the IE5 hacks in the CSS)

From what I can tell, the programmer set a position: absolute when the subnavigation is in the off state and hidden. I don't see any other positions. He also set the border to 0 and set it to float left. The z-index is set to 6000.

As for the JavaScripting, that's it.

I can give more information and the total program...
DonnaZ is offline
Reply With Quote
View Public Profile
 
Old 03-23-2007, 06:16 PM Re: Offset parent in IE6 (and maybe 7)
Super Talker

Posts: 116
Trades: 0
Another note...

I'm not used to JavaScript programming with the DOM. I tried
Subnav9.style.left = Subnav9.offsetParent;

- as I didn't know if ".left" was a part of offsetParent. It still didn't work.

It looks great in Mozilla & Opera.... God bless them!
DonnaZ is offline
Reply With Quote
View Public Profile
 
Old 03-23-2007, 08:05 PM Re: Offset parent in IE6 (and maybe 7)
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
I'd have to see the html/css to figure out what might be the problem. Have you got a URL ?
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-24-2007, 11:26 PM Re: Offset parent in IE6 (and maybe 7)
Super Talker

Posts: 116
Trades: 0
As I said, I inherited this mess. I actually have to clean up the style sheet for the submenu width - where in both IE and Mozilla you'll see the red color go off the container. This is an easy fix.

Here's the URL that shows the offsetParent working in Mozilla (but not in IE)

http://www.musiciansatlas.com/pages/menu_fix.asp

Scroll over the PRESS section

The original menu is in www.musiciansatlas.com. You'll see the submenus for the short ones (like Press) line up. That's because the margin-left was used for IE. They won't line up in Mozilla.

Is there a difference between using offset and offsetParent between IE and Mozilla?

Thanks - Donna
DonnaZ is offline
Reply With Quote
View Public Profile
 
Old 03-25-2007, 12:34 AM Re: Offset parent in IE6 (and maybe 7)
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
That's ugly....

I guess I have to ask, why are you scripting that menu at all ? You really don't need to, it can all be done with CSS alone. Check out this drop-line menu: http://www.cssplay.co.uk/menus/dd_valid_2.html

This one is very much like yours:
http://www.cssplay.co.uk/menus/doors...ine_three.html

It's very hard when you inherit stuff like this, sometimes it's easier to just rip out the old and start fresh.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 03-25-2007, 04:45 PM Re: Offset parent in IE6 (and maybe 7)
Super Talker

Posts: 116
Trades: 0
Lady,

Thanks.

Actually the whole site is ugly!!!!! I can't tell you how this hurts me professionally! Thank goodness I code and not design!

Thanks for the suggestions and the sites. The problem isn't the secondary navigation appearing underneath. My bosses (and other users) want single item submenus to line up not on the left, but under the menu itself.

Thus, the PRESS and Newsletter. Newsletter right now will line up to the left... and that's the problem. The powers-that-be want it to line up underneath Press which means different positioning for different browsers.

What I'm going to do is to use JavaScript to call up different css styles based on browser and version as I discovered this menu has vertical alignment problems under IE7.

Donna
DonnaZ is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Offset parent in IE6 (and maybe 7)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44766 seconds with 12 queries