NS + JS = BS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • The Plankmeister

    #1

    NS + JS = BS

    This:

    document.getEle mentById("conte nt_container"). style["marginTop"] = 20;

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

    P.


  • David Dorward

    #2
    Re: NS + JS = BS

    The Plankmeister wrote:[color=blue]
    > document.getEle mentById("conte nt_container"). style["marginTop"] = 20;
    > works as expected in IE6 and O7. But not in NS7. Anyone know why?[/color]

    I think it should be .style.marginTo p

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


    --
    David Dorward http://dorward.me.uk/

    Comment

    • The Plankmeister

      #3
      Re: NS + JS = BS

      Sooperdooper! Works a treat! : )



      "David Dorward" <dorward@yahoo. com> wrote in message
      news:bjo2ja$dp$ 1$8300dec7@news .demon.co.uk...[color=blue]
      > The Plankmeister wrote:[color=green]
      > > document.getEle mentById("conte nt_container"). style["marginTop"] =[/color][/color]
      20;[color=blue][color=green]
      > > works as expected in IE6 and O7. But not in NS7. Anyone know why?[/color]
      >
      > I think it should be .style.marginTo p
      >
      > but I KNOW that it should be "20px" not 20.
      >
      >
      > --
      > David Dorward http://dorward.me.uk/[/color]


      Comment

      • Grant Wagner

        #4
        Re: NS + JS = BS

        The Plankmeister wrote:
        [color=blue]
        > This:
        >
        > document.getEle mentById("conte nt_container"). style["marginTop"] = 20;
        >
        > works as expected in IE6 and O7. But not in NS7. Anyone know why?
        >
        > P.[/color]

        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:

        />.

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

        document.getEle mentById("conte nt_container"). style["marginTop"] = "20px";

        --
        | Grant Wagner <gwagner@agrico reunited.com>

        * Client-side Javascript and Netscape 4 DOM Reference available at:
        *


        * 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


        Comment

        Working...