ʹò

1µjscssļ
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="../src/jquery.smooth-scroll.js"></script>
<script src="../lib/jquery.ba-bbq.js"></script>
2headǩмjs
$(function(){
$("#btn").click(function(){
$('a').smoothScroll({
//б
});
});
})
3bodyǩмӦıǩ
˵

1׵ʵֻҳĳλ
2ò
$('a').smoothScroll();
3ԸԼҪָһⲿôڷҳ漶
$('#container a').smoothScroll();
4ͨķʽųָİԪ
$('#container a').smoothScroll({
excludeWithin: ['.container2']
});
5ͨųָԪ
$('a').smoothScroll({
exclude: ['.rough','#chunky']
});
6ĸλþֹͣ
$('.backtotop').smoothScroll({
offset: -100
});
7趨һʼ֮ǰĻص
$('a').smoothScroll({
beforeScroll: function() {
alert('ready to go!');
}
});
8趨һĻص
$('a').smoothScroll({
afterScroll: function() {
alert('we made it!');
}
});
9һťֵ֧ص֮ǰλãʵϾһʷ¼


$.smoothScroll({
//λõƫ
offset: 0,
//ķ򣬿ȡ 'top'  'left'
direction: 'top',
// ֻедĬΪʱŻõ
scrollTarget: null,
// ʼǰĻص`this` ڱԪ
beforeScroll: function() {},
//ɺĻص `this` Ԫ
afterScroll: function() {},
//Ч
easing: 'swing',
//ٶ
speed: 400,
// "Զ" ٵϵ
autoCoefficent: 2
});