Giter VIP home page Giter VIP logo

jquery.ui.scrollbar's Introduction

jQuery UI Scrollbar

This is a simple scrollpane type component for jQuery UI. It is intended to be a general purpose component, used anytime you need a custom JS scrollbar in a jQuery UI environment. It is adapted out of frustration of turning the slider example of a horizontal scrollbar into a vertical scrollbar.

Usage

Using the plugin is simple. Just include jQuery, jQuery UI, js/jquery.ui.scrollbar.js (or the minified version), and css/jquery.ui.scrollbar.css. If you want to use the mouse wheel handler, make sure you include [Brandon Aaron's mouse wheel jQuery plugin] (https://github.com/brandonaaron/jquery-mousewheel).

$(document).ready(function()
{
  $(".scroll-pane").scrollbar({orientation: 'vertical'});
});

Where .scroll-pane is the name of the element(s) you want to wrap. By default the plugin will set the orientation to 'horizontal'.

Options

Other options that can be set are:

  • scrollFactor - How far the mousewheel will scroll per event.
  • easing - The easing function to use for the scrolling animation.
  • animationDuration - How long (in milliseconds) the animation will take for one unit (divided by distance).

The default options are:

{
	orientation: "horizontal",
	scrollFactor: 15,
	easing: 'linear',
	animationDuration: 20
}

Methods

If the content inside of the scrollbar changes in size, the .resize() method should be called. Since this component is written as a UI widget, this method needs to be called a certain way:

$(".scroll-pane").data("scrollbar").resize();

One day, all browsers may actually support a resize event for all elements and not just the window object.

Themes

By default, the plugin will use your default jQuery UI theme.

If you want to theme the plugin, there is an example of a theme in the css/themes/greyshade.css file. This theme is used in the example.

jquery.ui.scrollbar's People

Contributors

adaburrows avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jquery.ui.scrollbar's Issues

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.