Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Fukui

macrumors 68000
Original poster
Jul 19, 2002
1,630
18
This is reaaly annoying, ,but I'm trying to implement scrolling behavior in a web app and I'm getting that object.style.left etc always returns "Undefined," even when set in CSS file!

Ok, if I set the left or top property inline such as, "style=left:2; top:4" it works and object.style.left properly returns 2px, but if set in an external CSS it doesnt work.

Any clue to why this is??
 

Fukui

macrumors 68000
Original poster
Jul 19, 2002
1,630
18
FattyMembrane said:
i have the same problem and haven't been able to figure it out. i'd be very thankful if someone has an answer or solution.
Seems like nobody knows...
I'll check the apple mailing lists, if I get any response I'll post it here...
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
As a workaround you could just use descendancy and use the element type in your stylesheet for the object the js is working on.

For instance, if the scrolling text is in a <div>, add a container <div> with an id on it and set the style for "#id div" in your stylesheet.
 

Fukui

macrumors 68000
Original poster
Jul 19, 2002
1,630
18
Rower_CPU said:
As a workaround you could just use descendancy and use the element type in your stylesheet for the object the js is working on.

For instance, if the scrolling text is in a <div>, add a container <div> with an id on it and set the style for "#id div" in your stylesheet.
Yea, I've done that, but was hoping there could be another solution... is this behavior W3C or what? IE, FF and Safari all exhibit this...
 

Rower_CPU

Moderator emeritus
Oct 5, 2001
11,219
2
San Diego, CA
That's no fun.

Seems like another argument for separation of content (HTML), presentation (CSS), and behavior (JS) to me.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.