Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Progressive JPEGs with Javascript

Status
Not open for further replies.

kumar2222

IS-IT--Management
May 30, 2008
7
CA
I would like to load some progressive JPEGS with a Javascript.

Essentially when a user scrolls over a thumbnail, I do object.src='pictureX.jpg'. Which of course works.

Problem is the picture is not displayed until it is fully loaded. The images I am loading are rather large and take 3-4 seconds to load.

Unlike when I do <img src="pictureX.jpg">, where the picture is loaded gradually. Obviously that being the point of progressive JPEGs.

How can I get Javascript to start displaying the picture as the progressive JPEG is loaded?

Any help is appreciated.

Kumar
Virtech Computer Consulting and Networking
 
Wikipedia said:
progressive JPEGs are not as widely supported, and even some software which does support them (such as some versions of Internet Explorer) only displays the image once it has been completely downloaded.

It sounds like you might be better off either:

- Preloading the larger image, or

- Using the lowSrc attribute of the image object (which no-one seems to do these days - why not?) before changing the normal src.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top