1
私がしようとしているのは、マウスが「次の」ボタンの上にある場合、遅い速度で右にスクロールし、マウスが「次の」ボタンの上にない場合、スクロールを停止するかどうかです。フィドルここjquery scrollLeft auto?
var $container = $('#display-container'),
scroll = $container.width();
$('#next-button').hover(function() {
$container.animate({
'scrollLeft': scroll
}, 500);
}, function(){
$container.stop();
});
ます:ここ
は http://jsfiddle.net/mdanz/nCCRy/14/$(function() {
$('#next-button').hover(function() {
$('#display-container').animate({
'scrollLeft': '+=120px'
}, '500');
});
});
感謝しかし、どのように私はそれが年末までscrollLeft作るのですかホバー上のdiv?私は120pxを置くが、私はそれがdivの終わりに達するまで無限にスクロールすることを望む。 – user892134
また、最初の関数の後にカンマを追加して別の関数を記述するときの用語は何ですか?代替機能? – user892134
@ user892134 - 私の更新を参照してください。 –