Making an Image Fade In

Even when image files are made as small as possible, it can still take a while for them to download. Initially, browsers had to load and process the entire file before it began to present the image onscreen. This meant users had to sit there staring at a blank screen for minutes at a time. Because user attention spans are short, people would often give up in frustration and move on to another page instead of waiting for an image to finish downloading.

Since those early days, two approaches to reducing user frustration have emerged. Both involve having an image "fade in" as the image data is read by the browser. The user sees a blurry, incomplete image at first, but then the image quality improves as more data is read in. ...

Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.