Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > NS + JS = BS

Reply
Thread Tools

NS + JS = BS

 
 
The Plankmeister
Guest
Posts: n/a
 
      09-10-2003
This:

document.getElementById("content_container").style["marginTop"] = 20;

works as expected in IE6 and O7. But not in NS7. Anyone know why?

P.


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      09-10-2003
The Plankmeister wrote:
> document.getElementById("content_container").style["marginTop"] = 20;
> works as expected in IE6 and O7. But not in NS7. Anyone know why?


I think it should be .style.marginTop

but I KNOW that it should be "20px" not 20.


--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
 
 
 
The Plankmeister
Guest
Posts: n/a
 
      09-10-2003
Sooperdooper! Works a treat! : )



"David Dorward" <(E-Mail Removed)> wrote in message
news:bjo2ja$dp$1$(E-Mail Removed)...
> The Plankmeister wrote:
> > document.getElementById("content_container").style["marginTop"] =

20;
> > works as expected in IE6 and O7. But not in NS7. Anyone know why?

>
> I think it should be .style.marginTop
>
> but I KNOW that it should be "20px" not 20.
>
>
> --
> David Dorward http://dorward.me.uk/



 
Reply With Quote
 
Grant Wagner
Guest
Posts: n/a
 
      09-11-2003
The Plankmeister wrote:

> This:
>
> document.getElementById("content_container").style["marginTop"] = 20;
>
> works as expected in IE6 and O7. But not in NS7. Anyone know why?
>
> P.


Works fine in Netscape 7.1 and Mozilla/5.0 (Windows; U; Windows NT 5.0;
en-US; rv:1.5b) Gecko/20030909, so I'd suspect it's something called a "bug"
<url:
http://searchsecurity.techtarget.com...211714,00.html
/>.

You may want to try setting the style property as a string, complete with
units since that's what "marginTop" actually is:

document.getElementById("content_container").style["marginTop"] = "20px";

--
| Grant Wagner <(E-Mail Removed)>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off




Advertisments