Solved

Page using phpFlickr not showing until all images load

Posted on 2010-08-31
4
290 Views
Last Modified: 2013-11-13
I'm using phpFlickr to load images from photosets from Flickr. The page isn't showing until all the images load. I want the images to start showing before they're all loaded so the page doesn't look like it's broken. Is this normal behavior, and if so, is it possible to stop?
0
Comment
Question by:cowboygeek
  • 2
  • 2
4 Comments
 
LVL 34

Accepted Solution

by:
Beverley Portlock earned 500 total points
ID: 33575820
This often depends on a mix of the browser and how the page is built. For instance, with Opera it waits until the whole pages is downloaded and then draws the page. I have always found this behaviour irritating. With other browsers it depends....

The browser often has to wait until a layout element is complete before it can compute the precise details of displaying it. If your images are within this layout element then they wait too. I have seen people send a near empty page down and then post-populate the divs using Ajax.

Try loading each image set in a separate TABLE or DIV so that the broswer can figure out what it has to do at the end of each </TABLE> or </DIV>. I'd be tempted to use a table with one row and one column as a container for the images as a table has the hasLayout property.

0
 

Author Closing Comment

by:cowboygeek
ID: 33583843
I actually do have them in tables already. My temporary solution is to separate the thumbs into pages so fewer of them load at once. I'll look into the Ajax solution; would that require Javascript? I'm not too familiar with Ajax.
0
 
LVL 34

Expert Comment

by:Beverley Portlock
ID: 33584089
Yes. The "J" in ajax stands for javascript but there are frameworks that can help with it. JQuery is a popular one and for PHP, SAJAX can be straightforward too.
0
 

Author Comment

by:cowboygeek
ID: 33601187
Excellent, thanks! I'd give you points if I could. I'm very experienced with jQuery, just never used it for Ajax before. Thanks!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now