SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Preloader

  1. #1
    SitePoint Enthusiast johnmanoahs's Avatar
    Join Date
    Jul 2004
    Location
    India
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Preloader

    Hi all,
    I've created a full website package, containing almost 25 html files with more than 15 images and some flash files. After I hosted it, I found that everytime i opened a page, the image loads slowly. How can I preload the whole package once my webpage gets loaded the first time. How can I set a loader bar tat specifies the loaded content.

    Can anyone help me with the code or reply back with the site containing a preloader for an entire package?

    Thanks in advance,
    John

  2. #2
    SitePoint Addict justjon's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    237
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I know you can't build a preloader for a HTML site. You can build one for the Flash content. If you do a search for flash preloaders you'll find loads of stuff.

  3. #3
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as I know you can't build a preloader for a HTML site. You can build one for the Flash content. If you do a search for flash preloaders you'll find loads of stuff.
    I think you can, although i wouldnt know how, but i have seen it on some sights.

    a possibility would be to use css to define a background image for your picture which could show an animated .gif of a loading bar.

    Not really sure how it would work, nor if the background would actually load first! but its probibly worth a try...

  4. #4
    SitePoint Addict justjon's Avatar
    Join Date
    Mar 2004
    Location
    UK
    Posts
    237
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you could put an animated image that says loading in the background of individual elements like large images etc. But I don't think there is a way of finding out how much of a particular element is loaded (which would obviously be what you have to do to display a progress bar). I suppose that if you could, in theory you would be able to check the progress of all elements and therefore display a progress bar for the whole site (But I don't think you can).

  5. #5
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    You can do this through javascript. I used to have the code for this but don't seem to anymore. Sorry.

  6. #6
    SitePoint Aficionado JVLB's Avatar
    Join Date
    Jan 2002
    Location
    N 44 56.537' W 123 3.683'
    Posts
    1,127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can force the preloading of images by simply placing them in a hidden div. They then become available from the browser cache. HTML pages are a different problem and you probably don't stand to gain much from preloading them anyway. Since straight HTML pages tend to be small and because loading one will generally create a HTTP request to see if the content is expired, even if the page is in cache you won't gain much.

  7. #7
    SitePoint Enthusiast johnmanoahs's Avatar
    Join Date
    Jul 2004
    Location
    India
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reg Preloader

    Hi all,
    Thanxx for your responses...i found a link where a Javascript preloader can be created.

    http://www.soft32.com/download-JavaS...r-14242-5.html

    This concept works well, except that it doesn't display an animated progressive 'loading' bar.

    I have another question: Can i use a flash loader bar for my HTML site ???

    - John

  8. #8
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I also remeber seeing a class on phpclasses (http://www.phpclasses.org) called laoding bar (or something like that) which i guess would do the same thing...

    havent tried it out thought...

  9. #9
    SitePoint Guru toasti's Avatar
    Join Date
    Feb 2004
    Location
    Grahamstown
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is the url: http://www.phpclasses.org/browse/package/1964.html

    and a description:
    This class is meant to display the progress of a server side task by the means of bar that is displayed and updated in an HTML page.

    This class is a fork based on ProgressBar class written originally by Mika Turin.

    This version of the class features:

    - Rewritten the JavaScript and DHTML code to generate valid HTML 4.01 strict code that works with any browser now
    - Added the setDirection() function to move the progress bar in all directions
    - Added the hideBar() and unhideBar() functions to hide or unhide the progress bar
    - Added the $show_percent and $brd_width style variables

  10. #10
    SitePoint Wizard
    Join Date
    Mar 2001
    Posts
    3,537
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How does knowing when a server side task is accomplished tell you the progress of something loading in the client's browser?

  11. #11
    SitePoint Enthusiast IBFreddy's Avatar
    Join Date
    Dec 2004
    Location
    San Francisco
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's been my experience that those JS preloaders can be a tad picky and not too fun to set up. I had to use one for a project and I'm very happy I don't have to do that again.

    Good luck!
    www.somerandomdude.net (that's me)

    Current project: http://www.cyark.org


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •