How to do the image fade-in effect upon scroll (li

2019-03-16 05:18发布

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.

5条回答
ゆ 、 Hurt°
2楼-- · 2019-03-16 05:48

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

查看更多
▲ chillily
3楼-- · 2019-03-16 05:50
趁早两清
4楼-- · 2019-03-16 06:05

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'});
}
查看更多
何必那么认真
5楼-- · 2019-03-16 06:05

Unfortunatelly, the Lazy Load plugin not works in most actual browsers, according the own author says in the official web site.

But the jQuery Appear Plugin do almost the same thing! ;-)

查看更多
女痞
6楼-- · 2019-03-16 06:09

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

查看更多
登录 后发表回答