smooth icon indicating copy to clipboard operation
smooth copied to clipboard

Auto Resize

Open RedskyThirty opened this issue 7 years ago • 2 comments

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(...);

RedskyThirty avatar Jul 05 '18 11:07 RedskyThirty

@RedskyThirty hey! kinda useful, I just changed easing in the src before :) Do you still use this library for your projects? I met Firefox lag problem. Dunno how to solve it.

1337jick avatar Sep 03 '19 06:09 1337jick

@1337jick Hi! I used it only once and to be honest, I don't remember on which project... :-)

RedskyThirty avatar Sep 03 '19 07:09 RedskyThirty