views:

1704

answers:

4

Hi,

I'm wondering about the fade-in effect for images on mashable.com (see http://mashable.com/2009/08/14/google-android-logo-remixes/ for example)

As you scroll to the image, it fades in. It's not fading in on page load, only upon the actual appearance of the item on-screen.

Thanks.

+1  A: 

It's achieved with the jQuery plugin Lazy Load.

EDIT: Here's the code they used:

if(! navigator.userAgent.toLowerCase().match('ipad')){
  $('#primary img').lazyload({effect:'fadeIn',placeholder:'/wp-content/themes/v6/_base/img/blank.png'});
}
Vincent
Thanks, I figured it was something like "delay load" and "lazy load" it is :)
Computer Guru
A: 

is there a prototype + scriptaculous equivalent?

bunq
Just as the jQuery plugin is named Lazy Load, the actual method is named lazy loading, so I am sure there are equivalents for any library.
Braxo
+1  A: 

Found the mootools version of the lazyload http://davidwalsh.name/mootools-lazyload

Argyris
A: 

A YUI version is available too. In fact, Lazy Load was inspired by it.

Drew Noakes