Place elements before loading images

Discussion in 'Javascript' started by josvanr@xs4all.nl, Mar 1, 2005.

  1. Guest

    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?

    Jos
    , Mar 1, 2005
    #1
    1. Advertising

  2. Evertjan. Guest

    wrote on 01 mrt 2005 in comp.lang.javascript:

    > 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?
    >


    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)
    Evertjan., Mar 1, 2005
    #2
    1. Advertising

  3. napisał(a):
    > 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?
    >


    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 : : :: ::::
    Tomasz Cenian, Mar 1, 2005
    #3
  4. Guest

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

    Jos
    , Mar 1, 2005
    #4
  5. Evertjan. Guest

    wrote on 01 mrt 2005 in comp.lang.javascript:

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


    [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)
    Evertjan., Mar 1, 2005
    #5
  6. Guest

    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.?
    , Mar 1, 2005
    #6
  7. napisał(a):
    > 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.?
    >


    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 : : :: ::::
    Tomasz Cenian, Mar 1, 2005
    #7
  8. Guest

    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.
    , Mar 1, 2005
    #8
  9. Evertjan. Guest

    wrote on 01 mrt 2005 in comp.lang.javascript:

    > 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.
    >


    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)
    Evertjan., Mar 1, 2005
    #9
  10. JRS: In article <Xns960CB2168527Eeejj99@194.109.133.29>, dated Tue, 1
    Mar 2005 16:30:22, seen in news:comp.lang.javascript, Evertjan.
    <> posted :
    > wrote on 01 mrt 2005 in comp.lang.javascript:
    >
    >> 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.
    >>

    >
    >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.


    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.demon.co.uk/news-use.htm> : about usage of News.
    No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.
    Dr John Stockton, Mar 1, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Styve
    Replies:
    22
    Views:
    1,099
    steve
    Feb 22, 2006
  2. Mufasa
    Replies:
    4
    Views:
    366
    Mark Rae [MVP]
    Aug 30, 2007
  3. Chris
    Replies:
    11
    Views:
    590
    Jonathan N. Little
    Nov 22, 2007
  4. news
    Replies:
    3
    Views:
    126
    Stephen Ingrum
    Nov 28, 2003
  5. marss
    Replies:
    0
    Views:
    97
    marss
    Jan 12, 2006
Loading...

Share This Page