First, Perfect scrollbar function description
Perfect ScrollBar is able to depict an unusual page UI depiction. If you want to be able to design a different page UI design, Perfect scrollbar may be the solution you're looking for, a simple but awesome scroll bar description plugin.
Perfect ScrollBar Download
Second, Perfect ScrollBar main characteristics:
• CSS that does not need to modify any of the elements
• The scroll bar does not affect the original page layout design
• Scroll bar supports full customization
• The size and position of the scroll bar will vary depending on the size or content of the container
• Relies on jquery and several classes of related libraries
• No need to define width and height. It will be fixed at the bottom right of the container.
• You can modify the style of any scroll bar without relying on other scripts
• The scroll bar supports the ' update ' method. If you need to change the position and size of the scroll bar, just call this method to
• Do not use ' scrolltop ' and ' scrollleft ', not with any absolute positioning
Third, Perfect scrollbar use requirements:
• Must have a content element
• The container must have a ' position ' CSS style definition
• The position of the scroll bar must be ' absolute '
Scrollbar-x must have a bottom style definition, scrollbar-must have a style definition of ' right '
Four, Perfect scrollbar instance code:
HTML code
<style> #Demo {position: ' relative ';} </style><div id= ' Demo ' ><div> ... </div></div >javascript$ (' #Demo '). Perfectscrollbar ();
If the container size or position changes, call the following method:
$ (' #Demo '). Perfectscrollbar (' Update ');
If you need to destroy it, call the following:
$ (' #Demo '). Perfectscrollbar (' destroy ');
If you need to scroll to a specific location, call the following:
$ ("#Demo"). ScrollTop (0); $ ("#Demo"). Perfectscrollbar (' Update ');
Perfect ScrollBar Plugin Use method