jQuery 滚动插件:ScrollAdvance

jopen 9年前

ScrollAdvance 是 jQuery 插件,为滚动位置添加有用的功能,比如 scrollBottom(), scrollRight() 或者 scrollCenter()在线演示

jQuery 滚动插件:ScrollAdvance

$(document).ready(function(){      $(document).scrollRight(0,{duration:4000,ease:'swing'});  });

Set the scroll position at far right with an animation of 4 seconds duration.

functions

$(this).scrollBottom();_______________________________returns the number of pixels that are hidden from view under the scrollable area. If the scroll bar is at the very bottom, or if the element is not scrollable, this number will be 0.   $(this).scrollRight();________________________________returns the number of pixels that are hidden from view to the right of the scrollable area. If the scroll bar is at the very right, or if the element is not scrollable, this number will be 0.  $(this).scrollCenter();_______________________________returns the current coordinates of the center of the view. returns an object containing the properties x and y.    $(this).scrollBottom(value [,options]);_______________set the vertical scroll position for the number of pixels that are hidden from view under of the scroll area is equal to value.  $(this).scrollRight(value [,options]);________________set the horizontal scroll position for the number of pixels that are hidden from view to the right of the scroll area is equal to value.    $(this).scrollCenter(value,value [,options]);_________set the vertical and/or horizontal scroll for the current coordinates of the center of the view is equal to coordinates x and y put in parameter.  $(this).scrollCenter(target [,options]);______________set the vertical and/or horizontal scroll for the current coordinates of the center of the view is equal to center of the target.    $(this).scrollTopLeft(target [,options]);_____________set the scroll position for the target is at the top left of the view.  $(this).scrollTopRight(target [,options]);____________set the scroll position for the target is at the top right of the view.  $(this).scrollBottomLeft(target [,options]);__________set the scroll position for the target is at the bottom left of the view.  $(this).scrollBottomRight(target [,options]);_________set the scroll position for the target is at the bottom right of the view.

See (http://api.jquery.com/animate/) to know options of animation. options parameter must be a PlainObject type, a jQuery object for target parameter and a numeric number for value parameter.

jQuery required version >=1.6.0

项目主页:http://www.open-open.com/lib/view/home/1410763673601