jQuery 滾動插件:ScrollAdvance
ScrollAdvance 是 jQuery 插件,為滾動位置添加有用的功能,比如 scrollBottom()
, scrollRight()
或者 scrollCenter()
。在線演示
$(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
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!