2015-07-30 9 views

ответ

1

Вы можете использовать функцию анимации jQuery для нее.

$('html').animate({ scrollTop: '0' }); 
0

Я использую velocity.js и JSNI вызов:

public static native void setAnimatedScrollTop(MyView instance, String topElementId, String scrollPanelId, int offsetPosition) /*-{ 
    $wnd.Velocity($wnd.document.getElementById(topElementId), 'scroll', 
     {duration: 1000, offset: offsetPosition, container: $wnd.document.getElementById(scrollPanelId), 
      complete: function(){ 
       [email protected]View::setScrollAnimationInProgress(Z)(false); 
      } 
    }); 
}-*/; 
Смежные вопросы