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 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
转载本站原创文章,请注明出处,并保留原始链接、图片水印。
本站是一个以用户分享为主的开源技术平台,欢迎各类分享!