The Artima Developer Community
Sponsored Link

Python Buzz Forum
Reloading images without flicker

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Phillip Pearson

Posts: 1083
Nickname: myelin
Registered: Aug, 2003

Phillip Pearson is a Python hacker from New Zealand
Reloading images without flicker Posted: Jul 12, 2005 9:00 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Phillip Pearson.
Original Post: Reloading images without flicker
Feed Title: Second p0st
Feed URL: http://www.myelin.co.nz/post/rss.xml
Feed Description: Tech notes and web hackery from the guy that brought you bzero, Python Community Server, the Blogging Ecosystem and the Internet Topic Exchange
Latest Python Buzz Posts
Latest Python Buzz Posts by Phillip Pearson
Latest Posts From Second p0st

Advertisement

Finally found how to refresh an image in a document without making the old image disappear while the new one loads. I know I'm going to forget this if I don't write it down, so...

foo = new Image();
foo.src = url_of_new_image;
foo.onerror = function_to_call_if_download_fails;
foo.onload = function_to_call_when_download_finishes;

Then stash foo away somewhere, and when the foo.onload function gets called, copy foo.src over to the image you want to refresh.

Comment

Read: Reloading images without flicker

Topic: partners in crime Previous Topic   Next Topic Topic: Announcing lesscode.org

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use