Using jQuery to create a scroll bar like MacLionOS _ jquery

Source: Internet
Author: User
This article uses nanoscrollerjs to easily implement the special effects of the MacOS system scroll bar, as well as the use methods and parameters of this plug-in. It is very good. We recommend it to you here. NanoScrollerJS is a jQuery plug-in that implements the scroll bar Effect of Mac OS X Lion system in a simple way. This scroll bar plug-in uses the smallest HTML structure. nano>. nano-content. Other scroll bar elements. pane>. nano-slider are dynamically loaded when the plug-in is running. The scroll bar plug-in uses the native scroll bar to work on iPad, iPhone, and some Android Tablets.

Usage

HTML Structure

The following is the HTML structure required for the work of the scroll bar plug-in:

The Code is as follows:



... Content here...



The class names of nano and nano-content can be changed through the plug-in parameters (the CSS file of the plug-in needs to be changed after the change ).

CSS style

In HTML

Introduce the nanoscroller.css file.

The Code is as follows:



You must specify a width and height for the container and customize some basic styles for your scroll bar, for example:

The Code is as follows:


. Nano {background: # bba; width: 500px; height: 500px ;}
. Nano>. nano-content {padding: 10px ;}
. Nano>. nano-pane {background: #888 ;}
. Nano>. nano-pane>. nano-slider {background: #111 ;}

JAVASCRIPT

Introduce the jquery. nanoscroller. js file to the page.

The Code is as follows:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.