2016-06-15 7 views

答えて

1

はあなたが

new FX.Scroll(window).toElementCenter('obj'); 

は基本的に意味し、この行を参照してください。

はidを持つ要素の中央に "obj"

をアニメーションスクロールを行うと、で実行できるjQueryで

var obj = $('#obj'); // cache the element 
$('html, body').animate({ 
    scrollTop: obj.offset() + (obj.height()/2) // scroll to top of element + half of its height 
}, 1000); // 1 second fast animation