Giter Club home page Giter Club logo

scrollbarreloaded's Introduction

ScrollbarReloaded

JavaScript scrollbar plugin to unify scrollbar styling. Supports IE10+, and all major browsers. Built-in master/slave hook. Supports 3 rendering types. Touch enabled.

Markup & Inline Options

  • Apply the attribute scrollbar-reloaded to applicable elements.
    • Providing a value of master-{namespace} will designate that element as the "master" scrollbar.
      • No inner element/content is necessary.
    • Providing a value of slave-{namespace} will designate that as a slave to the namespaced "master" scrollbar.
    • Providing an additional attribute of scrollbar-reloaded-x or scrollbar-reloaded-y with a value of false will ignore scrolling in the defined direction both visually and functionally.
    • Providing an additional attribute of scrollbar-reloaded-type with a value of:
      • default, no value, any value but "margin" or "scroll", or no attribute altogether will default to using position relative top/left.
        • RECOMMENDED (DEFAULT)
        • Best performance
      • margin will scroll using margin properties.
        • OK performance
      • scroll will use scrollTop/scrollLeft JavaScript properties, useful if integrating with another scroll-based plugin.
        • The parent element will receive a position of "relative" and should be styled to be immediately around the ScrollbarReloaded element.
        • IMPORTANT!: This slows down the UI do to reflow caused by scrollTop/scrollLeft, especially on IE.
      • FYI: Master scrollbars will work with a mix of the aforementioned scroll types.

Styles

  • Styles can be adjusted in the SCSS or CSS file.

Methods

  • bootstrap (global only) bootstraps elements with the scrollbar-reloaded attribute that haven't already been bootstrapped on the document.
  • bootstrapped (global only) returns an object with all ScrollbarReloaded instances and access to their methods destroy, reset and update.
  • destroy (global/instance) destroys document/window listeners.
  • reset (global/instance) resets heights/widths such as for use after the content size changes. (Window resizing reset is handled automatically).
  • update (global/instance) moves the element's scroll position to the x/y parameters provided as percentage floats. (Using a master scrollbar's instance update will cause it and the slaves to be scrolled to the same percentage).

Global Options & Usage

  • Apply scrollbar-reloaded attributes to applicable elements.
  • Create a global instance. Example: const mts = new ScrollbarReloaded();
    • Optionally, pass in an object with available properties of:
      • minHandleLength (int) default is 10 pixels
      • resizeDelay (int) default is 17 milliseconds
  • Call the bootstrap method to bootstrap applicable elements. Example: mts.bootstrap();.
  • NOTE: See "Markup & Inline Options" and "Methods" for more options.

scrollbarreloaded's People

Contributors

depthdev avatar

Watchers

James Cloos avatar Oasis Innocent avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.