gil*_*mas 6 jquery scroll jquery-animate
$(document).ready(function(){
$("#right_arrow").click(function(e) {
var scrollleftvar = $(window).scrollLeft();
e.preventDefault()
$("body").scrollLeft(scrollleftvar + 50);
});
});
Run Code Online (Sandbox Code Playgroud)
嗨,我试图动画或缓解上面触发的增量滚动eleft,但是挣扎了一点,任何帮助都会非常感激,谢谢
ins*_*ere 26
你可以使用.animate()-function:
$('body').animate( { scrollLeft: '+=50' }, 1000, 'easeOutQuad' );
Run Code Online (Sandbox Code Playgroud)
+=value或-=value来自当前值的动画(如偏移).有关更多信息,请参阅jQuery-Docs:".animate()".
| 归档时间: |
|
| 查看次数: |
22697 次 |
| 最近记录: |