Hello,
Thanks a lot for your work, it's really nice!
Personally, I added three optional options: "smoothContainerEase", "autoResize" and "logsEnabled".
this.vars = { preload: opt.preload || true, current: 0, target: 0, height: 0, documentHeight: 0, bounding: 0, timer: null, ticking: false, smoothContainerEase: opt.smoothContainerEase || 0.15, autoResize: typeof opt.autoResize !== 'undefined' ? opt.autoResize : true, logsEnabled: typeof opt.logsEnabled !== 'undefined' ? opt.logsEnabled : false };
smoothContainerEase:
if (this.smoothContainer) { this.smoothSection = { el: opt.smoothSection ? opt.smoothSection : document.body, animation: { transform: [{ transformType: 'translate3d', axis: 'y', ease: this.vars.smoothContainerEase, initialValue: 0 }] } }; }
autoResize
if(this.vars.autoResize) { var smooth = this; window.onresize = function() { smooth.resize(); } }
logsEnabled
if(this.vars.logsEnabled) console.log(...);
Hello,
Thanks a lot for your work, it's really nice!
Personally, I added three optional options: "smoothContainerEase", "autoResize" and "logsEnabled".
this.vars = { preload: opt.preload || true, current: 0, target: 0, height: 0, documentHeight: 0, bounding: 0, timer: null, ticking: false, smoothContainerEase: opt.smoothContainerEase || 0.15, autoResize: typeof opt.autoResize !== 'undefined' ? opt.autoResize : true, logsEnabled: typeof opt.logsEnabled !== 'undefined' ? opt.logsEnabled : false };smoothContainerEase:
if (this.smoothContainer) { this.smoothSection = { el: opt.smoothSection ? opt.smoothSection : document.body, animation: { transform: [{ transformType: 'translate3d', axis: 'y', ease: this.vars.smoothContainerEase, initialValue: 0 }] } }; }autoResize
if(this.vars.autoResize) { var smooth = this; window.onresize = function() { smooth.resize(); } }logsEnabled
if(this.vars.logsEnabled) console.log(...);