Place elements before loading images

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • josvanr@xs4all.nl

    #1

    Place elements before loading images

    HI

    I'm working on a site



    in which i use absolute positioning. On my pc at home i didn't notice,
    but
    now, as the site is on air and loading images is a bit slower, I notice
    that
    the positioning doesn't happen until after the images are loaded.
    Probably
    this is because I use 'onLoad' to call the function which centers my
    elements. Is there a way to do positioning before the images have
    loaded?

    Jos

  • Evertjan.

    #2
    Re: Place elements before loading images

    wrote on 01 mrt 2005 in comp.lang.javas cript:
    [color=blue]
    > I'm working on a site
    >
    > http://www.josvanriswick.nl/nieuw
    >
    > in which i use absolute positioning. On my pc at home i didn't notice,
    > but
    > now, as the site is on air and loading images is a bit slower, I notice
    > that
    > the positioning doesn't happen until after the images are loaded.
    > Probably
    > this is because I use 'onLoad' to call the function which centers my
    > elements. Is there a way to do positioning before the images have
    > loaded?
    >[/color]

    Start with building a page without frames,
    frames are evil if you want to use css and javascript,
    IMHO of course.

    Het ziet er verder best al mooi uit, hoor.

    "Stillevens " of "Stille wens"? ;-)

    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)

    Comment

    • Tomasz Cenian

      #3
      Re: Place elements before loading images

      josvanr@xs4all. nl napisał(a):[color=blue]
      > HI
      >
      > I'm working on a site
      >
      > http://www.josvanriswick.nl/nieuw
      >
      > in which i use absolute positioning. On my pc at home i didn't notice,
      > but
      > now, as the site is on air and loading images is a bit slower, I notice
      > that
      > the positioning doesn't happen until after the images are loaded.
      > Probably
      > this is because I use 'onLoad' to call the function which centers my
      > elements. Is there a way to do positioning before the images have
      > loaded?
      >[/color]

      Why are you using js to center the elements to begin with?
      Use javascript to spice up your page, add some additional functionality,
      never to get your page properly displayed.
      A lot of users simply turn javascript off, imagine what they will see...

      CSS is a correct and easy way to achieve this.

      --
      tomasz cenian tcenian at wa dot home dot pl
      :::: :: : : http://cenian.boo.pl : : :: ::::

      Comment

      • josvanr@xs4all.nl

        #4
        Re: Place elements before loading images

        hmm why? Yes I suppose the fixed part in the top of
        the page could also be done using a 'fixed' element..

        Jos

        Comment

        • Evertjan.

          #5
          Re: Place elements before loading images

          wrote on 01 mrt 2005 in comp.lang.javas cript:
          [color=blue]
          > hmm why? Yes I suppose the fixed part in the top of
          > the page could also be done using a 'fixed' element..
          >[/color]

          [please answer quoting relevant part of the original, this is not email,
          but usenet]

          Why not to use frames?

          Many reasons, though strong meanings differ as usual.
          <http://groups-beta.google.com/groups?q=frames .are.evil>
          <http://www.google.com/search?q=frames .are.evil>

          In your case because execution has to wait till the frames are loaded.

          --
          Evertjan.
          The Netherlands.
          (Replace all crosses with dots in my emailaddress)

          Comment

          • josvanr@xs4all.nl

            #6
            Re: Place elements before loading images

            Because I use absolute positioning and the positions
            I have to give depend on the width of the browser window.
            Maybe yes there are better ways to do this.?

            Comment

            • Tomasz Cenian

              #7
              Re: Place elements before loading images

              josvanr@xs4all. nl napisał(a):[color=blue]
              > Because I use absolute positioning and the positions
              > I have to give depend on the width of the browser window.
              > Maybe yes there are better ways to do this.?
              >[/color]

              Most definetely there is a better way to do this. You should really rely
              on CSS here.

              --
              tomasz cenian tcenian at wa dot home dot pl
              :::: :: : : http://cenian.boo.pl : : :: ::::

              Comment

              • josvanr@xs4all.nl

                #8
                Re: Place elements before loading images

                Hm... ok. But as I use a redirect-url for my page, I won't
                be able to get around using at least one frame. Also frames
                are convenient for storing static javascript variables (I mean
                variables that remain constant when one loads another page).
                Anyhow, I'll dig in to css some more to see if there is a way
                to solve it without using javascript in the first place.

                Comment

                • Evertjan.

                  #9
                  Re: Place elements before loading images

                  wrote on 01 mrt 2005 in comp.lang.javas cript:
                  [color=blue]
                  > Hm... ok. But as I use a redirect-url for my page, I won't
                  > be able to get around using at least one frame. Also frames
                  > are convenient for storing static javascript variables (I mean
                  > variables that remain constant when one loads another page).
                  > Anyhow, I'll dig in to css some more to see if there is a way
                  > to solve it without using javascript in the first place.
                  >[/color]

                  Sorry, I stop anwering if you expect us to look back to previous postings,
                  because you don't provide quoting.

                  It is against netiquette. Read the FAQ.

                  --
                  Evertjan.
                  The Netherlands.
                  (Replace all crosses with dots in my emailaddress)

                  Comment

                  • Dr John Stockton

                    #10
                    Re: Place elements before loading images

                    JRS: In article <Xns960CB216852 7Eeejj99@194.10 9.133.29>, dated Tue, 1
                    Mar 2005 16:30:22, seen in news:comp.lang. javascript, Evertjan.
                    <exjxw.hannivoo rt@interxnl.net > posted :[color=blue]
                    > wrote on 01 mrt 2005 in comp.lang.javas cript:
                    >[color=green]
                    >> Hm... ok. But as I use a redirect-url for my page, I won't
                    >> be able to get around using at least one frame. Also frames
                    >> are convenient for storing static javascript variables (I mean
                    >> variables that remain constant when one loads another page).
                    >> Anyhow, I'll dig in to css some more to see if there is a way
                    >> to solve it without using javascript in the first place.
                    >>[/color]
                    >
                    >Sorry, I stop anwering if you expect us to look back to previous postings,
                    >because you don't provide quoting.
                    >
                    >It is against netiquette. Read the FAQ.[/color]

                    The FAQ only says what should be done; in this case it appears necessary
                    to explain how it is done, since he uses Google. See below.

                    --
                    © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 MIME ©
                    Web <URL:http://www.uwasa.fi/~ts/http/tsfaq.html> -> Timo Salmi: Usenet Q&A.
                    Web <URL:http://www.merlyn.demo n.co.uk/news-use.htm> : about usage of News.
                    No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

                    Comment

                    Working...