winbox-ui-next
Version:
We Design Vue 2.0: A Vue.js 3 UI Library
32 lines (31 loc) • 780 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports[Symbol.toStringTag] = "Module";
var BTween = require("b-tween");
var is = require("../_utils/is.js");
function _interopDefaultLegacy(e) {
return e && typeof e === "object" && "default" in e ? e : { "default": e };
}
var BTween__default = /* @__PURE__ */ _interopDefaultLegacy(BTween);
function slide(el, top, cb) {
const tween = new BTween__default["default"]({
from: {
scrollTop: el.scrollTop
},
to: {
scrollTop: top
},
easing: "quartOut",
duration: 300,
onUpdate: (keys) => {
el.scrollTop = keys.scrollTop;
},
onFinish: () => {
if (is.isFunction(cb)) {
cb();
}
}
});
tween.start();
}
exports.slide = slide;