Skip to content

Auto Resize #1

@RedskyThirty

Description

@RedskyThirty

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions