require(['jquery', 'scrollto'], function($, scrollto) {
var scroll = new scrollto.ScrollTo({
dest: 500,
speed: 2000
});
scrollto.js
define('jquery', function($) {
function ScrollTo(opts) {
this.opts = $.extend({}, ScrollTo.DEFAULT, opts);
this.$el = $('html,body');
}
ScrollTo.prototype.move = function() {
var opts = this.opts;
this.$el.animate({
scrollTop: opts.dest
}, opts.speed);
};
ScrollTo.prototype.go = function() {
// var opts=this.opts;
this.$el.scrollTop(this.opts.dest);
};
ScrollTo.DEFAULT = {
dest: 0,
speed: 800
};
return {
ScrollTo: ScrollTo
};
});
define(["jquery"], function($) {});