Moving DIVs?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gernot Frisch

    #1

    Moving DIVs?


    Hi,


    this is where the DIVs of a menu get created:
    <div id="menudivs" class="m' + this.container. id + 'l' + this.depth +
    'i">'
    + this.fields[0] + "</div>

    How do I loop through all of them and move them by "dx" horizontally.
    (I want to put this in a window.onresize event handler)

    Thank you,

    --
    -Gernot

    Post here, don't email. If you feel you have to mail, revert my
    forename from:
    tonreG.Frisch.a t.Dream-D-Sign.de@invalid .com
    _______________ _______________ __________
    Looking for a good game? Do it yourself!
    GLBasic - you can do
    GLBasic is a programming language that supports multiple platforms like e.g. iPhone



  • Thomas 'PointedEars' Lahn

    #2
    Re: Moving DIVs?

    Gernot Frisch wrote:
    [color=blue]
    > this is where the DIVs of a menu get created:
    > <div id="menudivs" class="m' + this.container. id + 'l' + this.depth +
    > 'i">'
    > + this.fields[0] + "</div>
    >
    > How do I loop through all of them and move them by "dx" horizontally.[/color]

    RTFM. There are two ways:

    A) Move each "div" element. Obtain the collection of elements with
    document.getEle mentsByTagName( ) (W3C), document.all() (IE4+) or
    document.layers (NN4), then test against the className property
    of each element object.

    B) Change the value of the left property in the class selector
    (not in NS4 and Opera). Obtain the list of stylesheets for
    the document with document.styleS heets and the rules with
    the document.styleS heets[...].cssRules (Gecko) or the
    document.styleS heets[...].rules (IE) collection.
    [color=blue]
    > (I want to put this in a window.onresize event handler)[/color]

    Oh my. Use a proper stylesheet instead. What if client-side script
    support is restricted or disabled or the DOM does not support that at
    all? Thought about the user's system resources?


    PointedEars

    P.S.:
    Me@privacy.net is not a mailbox address ("A mailbox receives mail"):

    | Me@Privacy.net
    | SMTP error from remote mailer after RCPT TO:<Me@privacy. net>:
    | host privacy.net [66.46.181.115]:
    | 550 relaying mail to privacy.net is not allowed

    Thus using it violates Internet/NetNews standards (RFCs 1036
    and 2822). Even if it would receive mail, the automated
    response described on the website would still disregard
    Usenet Netiquette. So people using privacy.net addresses
    are automatically killfiled by me from now on.
    See [en] <http://www.interhack.n et/pubs/munging-harmful/>
    and/or [de] <http://gerlo.de/falsche-email-adressen.html>
    for details.

    P.P.S.: de.comp.lang.ja vascript exists.

    Comment

    • Gernot Frisch

      #3
      Re: Moving DIVs?

      > RTFM. There are two ways:

      Sorry, I don't have TFM. Where do I get it?
      [color=blue]
      > A) Move each "div" element. Obtain the collection of elements with
      > document.getEle mentsByTagName( ) (W3C), document.all() (IE4+) or
      > document.layers (NN4), then test against the className property
      > of each element object.[/color]

      Er... OK. I think I understand.
      [color=blue]
      > B) Change the value of the left property in the class selector
      > (not in NS4 and Opera). Obtain the list of stylesheets for
      > the document with document.styleS heets and the rules with
      > the document.styleS heets[...].cssRules (Gecko) or the
      > document.styleS heets[...].rules (IE) collection.[/color]

      That's not X-browser compatible, right?
      [color=blue][color=green]
      > > (I want to put this in a window.onresize event handler)[/color]
      >
      > Oh my. Use a proper stylesheet instead. What if client-side script
      > support is restricted or disabled or the DOM does not support that[/color]
      at[color=blue]
      > all? Thought about the user's system resources?[/color]

      The onresize is triggered quite often, huh? Can you give me a link to
      this approach you suggested? I'm a complete idiot when it comes to
      JavaScript.
      [color=blue]
      > Me@privacy.net is not a mailbox address ("A mailbox receives mail"):[/color]

      Sorry, It's for spam-reasons. Don't mail, post here.
      -Geront


      Comment

      Working...