dhtml/floating element question..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frances Del Rio

    #1

    dhtml/floating element question..



    I picked up this neat script from www.dynamicdrive.com that does
    something I had always wanted to do, namely put a div at a certain
    distance from bottom of pg (for name-&-add-of-co footer..) and have it
    stay there even if user scrolls up or down.. but: it gets screwed up
    if user resizes window -- unless they reload after resizing.. I know
    possibility of user resizing window is remote, but wanted to see anyway
    if there was a way to make it work even if user resizes window.. also,
    is there a way to make this script work in Netscape 6+?? thank you..

    Frances Del Rio

  • Thomas 'PointedEars' Lahn

    #2
    Re: dhtml/floating element question..

    Frances Del Rio wrote:
    [color=blue]
    > http://www.francesdelrio.com/fixed_div.html
    >
    > I picked up this neat script from www.dynamicdrive.com[/color]

    Eeek. What part exactly do you consider "neat"?
    [color=blue]
    > that does something I had always wanted to do, namely put a div at a
    > certain distance from bottom of pg (for name-&-add-of-co footer..) and
    > have it stay there even if user scrolls up or down.. but: it gets
    > screwed up if user resizes window -- unless they reload after resizing..[/color]

    Which should tell you that it is flawed, if not junk.
    [color=blue]
    > I know possibility of user resizing window is remote, but wanted to see
    > anyway if there was a way to make it work even if user resizes window..[/color]

    Use CSS and position:fixed. As it does not work
    with IE, you require a workaround for this browser:
    <http://www.fabrice-pascal.de/artikel/posfixedie6/>
    (I don't have a link to an English explanation,
    [1] Google is your friend [psf 6.1].)
    [color=blue]
    > also, is there a way to make this script work in Netscape 6+??[/color]

    Yes, do a complete rewrite to use standards compliant DOM methods.
    document.all previded by IE and Opera only.

    <http://www.w3.org/DOM/DOMTR>

    And, of course, [1].


    PointedEars
    --
    I have discovered a small, elegant proof that a^n + b^n = c^n has no integer
    solutions for n greater than 2, but this box doesn't do TeX, and I will
    except no lesser layout language.

    Comment

    • Frances Del Rio

      #3
      Re: dhtml/floating element question..

      Thomas 'PointedEars' Lahn wrote:
      [color=blue]
      > Frances Del Rio wrote:
      >[color=green]
      >>http://www.francesdelrio.com/fixed_div.html
      >>
      >>I picked up this neat script from www.dynamicdrive.com[/color]
      >
      > Eeek. What part exactly do you consider "neat"?[/color]
      touchée... the effect is neat, I meant.. I did feel the script was a
      bit "verbose" but since I don't know how to do this just made do w/it..
      [color=blue][color=green]
      >>that does something I had always wanted to do, namely put a div at a
      >>certain distance from bottom of pg (for name-&-add-of-co footer..) and
      >>have it stay there even if user scrolls up or down.. but: it gets
      >>screwed up if user resizes window -- unless they reload after resizing..[/color]
      >
      >
      > Which should tell you that it is flawed, if not junk.[/color]

      oops.. :) CSS position:fixed sounds like a great idea, but: how do I
      make div appear AT A CERTAIN DISTANCE FROM THE BOTTOM OF WINDOW,
      REGARDLESS OF HEIGHT OF CLIENTHEIGHT..

      in his script the guy has:

      function ietruebody(){
      return (document.compa tMode && document.compat Mode!="BackComp at")?

      document.docume ntElement : document.body
      }

      I have no idea what this does, but have a feeling this is the key here,
      because further down he has:

      var w=ietruebody(). clientWidth-195
      var h=50

      which on a hunch I changed to

      var w=100
      var h=ietruebody(). clientHeight-60

      and this worked in the sense it fixed my div where I wanted it..
      anyway, key here is I need this div (which is nothing but plain HTML
      text..) to show up about 60 px off the bottom of the screen, regardless
      of what clientHeight happens to be... and then when user scrolls for it
      to stay fixed.. is this possible?? in IE AND N??
      [color=blue]
      > Use CSS and position:fixed.[/color]
      this is not working.. here is code I have now:

      #footer {position:fixed ; top:200px; left:150px; z-index:1}

      (I actually want it a lot further down, but used this value just to
      test..) if position:fixed does not work w/z-index I'm in trouble, since
      I HAVE to have z-index, since everything on page is sitting on a bg img
      positioned w/z-index:0...

      I searched google for "CSS position:fixed" and among other things I
      found this page, http://devnull.tagsoup.com/fixed/
      where I found the weirdest code: for that img on top right that stays
      fixed when you scroll check out the code I found:

      <div class="overhead ">
      <h1><a href="http://tagsoup.com/"><imgalt="Tags oup homepage"
      src="/_img/logo.png"></a> <code>position: fixed</code>fixed for
      IE/win</h1></div>

      what on earth is this?? <code>...</code>.. who has ever seen such a
      thing? of course when I tried to implement it in my own situation it
      wouldn't work.. code on this page is full of really weird stuff, like
      for example,

      <divclass="foob ar"><code><ahre f="/">devnull</a>['<a href="/#toc">
      <abbrtitle="Tab le of contents">toc</abbr></a>']</code></div>

      ok, thank you very much for yr help.. Frances




      Comment

      • Frances Del Rio

        #4
        Re: dhtml/floating element question..

        Hello PointedEars.. :) actually I just found a very simple solution:


        #footer {position:fixed ; bottom:20px; left:150px; border:2px}

        and that's it.. it works beautifully.. and it even works if user
        resizes window... just that one little line of code.. it's almost too
        good to be true.. and it is!! it doesn't work in IE!! it only works
        in Netscape.. why is this??? and you know, I found this at the
        "official" CSS specs, at
        http://www.w3.org/TR/REC-CSS2/visure...ed-positioning..
        (nothing in there about how this only works in Netscape..) I know this
        has become a CSS question at this point, but since you responded to me
        before w/a CSS solution thought I'd run this one by you, in case you can
        shed some light.. (and I did post a query at the CSS ng...) ok.. thank
        you again.. Frances

        PS: are your ears really pointed??? :) :) :)


        Thomas 'PointedEars' Lahn wrote:
        [color=blue]
        > Frances Del Rio wrote:
        >
        >[color=green]
        >>http://www.francesdelrio.com/fixed_div.html
        >>
        >>I picked up this neat script from www.dynamicdrive.com[/color]
        >
        >
        > Eeek. What part exactly do you consider "neat"?
        >
        >[color=green]
        >>that does something I had always wanted to do, namely put a div at a
        >>certain distance from bottom of pg (for name-&-add-of-co footer..) and
        >>have it stay there even if user scrolls up or down.. but: it gets
        >>screwed up if user resizes window -- unless they reload after resizing..[/color]
        >
        >
        > Which should tell you that it is flawed, if not junk.
        >
        >[color=green]
        >>I know possibility of user resizing window is remote, but wanted to see
        >>anyway if there was a way to make it work even if user resizes window..[/color]
        >
        >
        > Use CSS and position:fixed. As it does not work
        > with IE, you require a workaround for this browser:
        > <http://www.fabrice-pascal.de/artikel/posfixedie6/>
        > (I don't have a link to an English explanation,
        > [1] Google is your friend [psf 6.1].)
        >
        >[color=green]
        >>also, is there a way to make this script work in Netscape 6+??[/color]
        >
        >
        > Yes, do a complete rewrite to use standards compliant DOM methods.
        > document.all previded by IE and Opera only.
        >
        > <http://www.w3.org/DOM/DOMTR>
        >
        > And, of course, [1].
        >
        >
        > PointedEars[/color]

        Comment

        • Michael Winter

          #5
          Re: dhtml/floating element question..

          On Sat, 21 Aug 2004 22:55:37 -0400, Frances Del Rio <fdr58@yahoo.co m>
          wrote:

          [snip]
          [color=blue]
          > <div class="overhead ">
          > <h1><a href="http://tagsoup.com/"><imgalt="Tags oup homepage"
          > src="/_img/logo.png"></a> <code>position: fixed</code>fixed for
          > IE/win</h1></div>
          >
          > what on earth is this?? <code>...</code>..[/color]

          It's simply another structural element. It marks the content as program
          source code. This is usually rendered in a fixed-width font like Courier.
          There are many other, similar mark-up elements. See section 9.2 of the
          HTML Specification - Structured text.

          <URL:http://www.w3.org/TR/html4/struct/text.html#h-9.2>
          [color=blue]
          > who has ever seen such a thing?[/color]

          Me. Several times. :)
          [color=blue]
          > of course when I tried to implement it in my own situation it wouldn't
          > work.. code on this page is full of really weird stuff, like for
          > example,
          >
          > <divclass="foob ar"><code><ahre f="/">devnull</a>['<a href="/#toc">
          > <abbrtitle="Tab le of contents">toc</abbr></a>']</code></div>[/color]

          The only "wierd" thing about this is that you've removed some critical
          whitespace that merges element and attribute names.

          Mike

          --
          Michael Winter
          Replace ".invalid" with ".uk" to reply by e-mail.

          Comment

          • Michael Winter

            #6
            [CSS] Re: dhtml/floating element question..

            On Sun, 22 Aug 2004 00:50:18 -0400, Frances Del Rio <fdr58@yahoo.co m>
            wrote:

            [Why doesn't position: fixed work?]

            The simple reason, as I'm sure you'll be told in CIWAS, is that IE is poor
            excuse for a browser. Microsoft simply haven't implemented it. Other
            decent (and recent) browsers, however, have.

            I'll leave it to the folks at CIWAS to provide alternate solutions.
            [color=blue]
            > PS: are [Lahn's] ears really pointed??? :) :) :)[/color]

            I've wondered that, too. Or at least where the nickname comes from. Star
            Trek/Fantasy literature fan?

            [Snipped top-post]

            Mike


            Please don't top-post.

            --
            Michael Winter
            Replace ".invalid" with ".uk" to reply by e-mail.

            Comment

            • Thomas 'PointedEars' Lahn

              #7
              Re: dhtml/floating element question..

              Frances Del Rio wrote:
              [color=blue]
              > [...] actually I just found a very simple solution [...]
              >
              > #footer {position:fixed ; bottom:20px; left:150px; border:2px}[/color]

              Yes, as I already wrote:[color=blue][color=green]
              >> Use CSS and position:fixed. [...][/color][/color]
              [color=blue]
              > and that's it.. it works beautifully.. [...]
              > it doesn't work in IE!! it only works in Netscape.. why is this???[/color]

              Because IE is junk and only few recognize it.
              That's why I recommended the workaround for IE:
              [color=blue][color=green]
              >> [...] As it does not work with IE, you require
              >> a workaround for this browser:
              >> <http://www.fabrice-pascal.de/artikel/posfixedie6/>
              >> (I don't have a link to an English explanation,
              >> [1] Google is your friend [psf 6.1].)[/color][/color]

              (You may want to read replies more thorougly.)

              However, I do not know if it is applicable to fixed bottom position as well.
              [color=blue]
              > [...] thank you again..[/color]

              You're welcome.
              [color=blue]
              > PS: are your ears really pointed??? :) :) :)[/color]

              Yes, indeed :)
              [color=blue]
              > [Top post][/color]

              <http://www.jibbering.c om/faq/faq_notes/pots1.html>


              PointedEars
              --
              "A good traveller has no fixed plans and is not intent on arriving."
              -- Lao Tzu

              Comment

              • Thomas 'PointedEars' Lahn

                #8
                Re: dhtml/floating element question..

                Frances Del Rio wrote:
                [color=blue]
                > [...] actually I just found a very simple solution [...]
                >
                > #footer {position:fixed ; bottom:20px; left:150px; border:2px}[/color]

                Yes, as I already wrote:[color=blue][color=green]
                >> Use CSS and position:fixed. [...][/color][/color]
                [color=blue]
                > and that's it.. it works beautifully.. [...]
                > it doesn't work in IE!! it only works in Netscape..[/color]

                It works in all Mozilla/5.0 which includes Netscape _6+_.
                [color=blue]
                > why is this???[/color]

                Because IE is junk and only few recognize it.
                That's why I recommended the workaround for IE:
                [color=blue][color=green]
                >> [...] As it does not work with IE, you require
                >> a workaround for this browser:
                >> <http://www.fabrice-pascal.de/artikel/posfixedie6/>
                >> (I don't have a link to an English explanation,
                >> [1] Google is your friend [psf 6.1].)[/color][/color]

                (You may want to read replies more thoroughly.)

                However, I do not know if it is applicable to fixed bottom position as well.
                [color=blue]
                > [...] thank you again..[/color]

                You're welcome.
                [color=blue]
                > PS: are your ears really pointed??? :) :) :)[/color]

                Yes, indeed :)
                [color=blue]
                > [Top post][/color]

                <http://www.jibbering.c om/faq/faq_notes/pots1.html>


                PointedEars
                --
                "A good traveller has no fixed plans and is not intent on arriving."
                -- Lao Tzu

                Comment

                Working...