// javascript document $(function(){ $('.top-img-group .item3').bind('imgshow',function(){ if($(this).hasclass('complete')){ return;} $(this).addclass('complete') $(this).find('.elem_3').css({opacity:0,display:'block'}).animate({width:300,left:120,top:25,opacity:1},500,'easeinoutbounce') }) function imganimate(){ var wintop = parseint($(window).scrolltop()); var offsettop = parseint($(window).outerheight())/1.5; $('.top-img-group .top-img-item').each(function(){ var thistop =parseint($(this).offset().top)-offsettop; if(wintop>thistop&&(wintop-thistop<650)){ $(this).trigger('imgshow'); } }) } imganimate(); $(window).scroll(function(){ window.imganimateinterval&&cleartimeout(window.imganimateinterval); window.imganimateinterval =settimeout(imganimate,50); }); })