1 2/*! 3 * jQuery.ScrollTo 4 * Copyright (c) 2007-2013 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com 5 * Dual licensed under MIT and GPL. 6 * 7 * @projectDescription Easy element scrolling using jQuery. 8 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html 9 * @author Ariel Flesler 10 * @version 1.4.6 11 * 12 * @id jQuery.scrollTo 13 * @id jQuery.fn.scrollTo 14 * @param {String, Number, DOMElement, jQuery, Object} target Where to scroll the matched elements. 15 * The different options for target are: 16 * - A number position (will be applied to all axes). 17 * - A string position ('44', '100px', '+=90', etc ) will be applied to all axes 18 * - A jQuery/DOM element ( logically, child of the element to scroll ) 19 * - A string selector, that will be relative to the element to scroll ( 'li:eq(2)', etc ) 20 * - A hash { top:x, left:y }, x and y can be any kind of number/string like above. 21 * - A percentage of the container's dimension/s, for example: 50% to go to the middle. 22 * - The string 'max' for go-to-end. 23 * @param {Number, Function} duration The OVERALL length of the animation, this argument can be the settings object instead. 24 * @param {Object,Function} settings Optional set of settings or the onAfter callback. 25 * @option {String} axis Which axis must be scrolled, use 'x', 'y', 'xy' or 'yx'. 26 * @option {Number, Function} duration The OVERALL length of the animation. 27 * @option {String} easing The easing method for the animation. 28 * @option {Boolean} margin If true, the margin of the target element will be deducted from the final position. 29 * @option {Object, Number} offset Add/deduct from the end position. One number for both axes or { top:x, left:y }. 30 * @option {Object, Number} over Add/deduct the height/width multiplied by 'over', can be { top:x, left:y } when using both axes. 31 * @option {Boolean} queue If true, and both axis are given, the 2nd axis will only be animated after the first one ends. 32 * @option {Function} onAfter Function to be called after the scrolling ends. 33 * @option {Function} onAfterFirst If queuing is activated, this function will be called after the first scrolling ends. 34 * @return {jQuery} Returns the same jQuery object, for chaining. 35 * 36 * @desc Scroll to a fixed position 37 * @example $('div').scrollTo( 340 ); 38 * 39 * @desc Scroll relatively to the actual position 40 * @example $('div').scrollTo( '+=340px', { axis:'y' } ); 41 * 42 * @desc Scroll using a selector (relative to the scrolled element) 43 * @example $('div').scrollTo( 'p.paragraph:eq(2)', 500, { easing:'swing', queue:true, axis:'xy' } ); 44 * 45 * @desc Scroll to a DOM element (same for jQuery object) 46 * @example var second_child = document.getElementById('container').firstChild.nextSibling; 47 * $('#container').scrollTo( second_child, { duration:500, axis:'x', onAfter:function(){ 48 * alert('scrolled!!'); 49 * }}); 50 * 51 * @desc Scroll on both axes, to different values 52 * @example $('div').scrollTo( { top: 300, left:'+=200' }, { axis:'xy', offset:-20 } ); 53 */ 54(function(c){var a=c.scrollTo=function(f,e,d){c(window).scrollTo(f,e,d)};a.defaults={axis:"xy",duration:parseFloat(c.fn.jquery)>=1.3?0:1,limit:true};a.window=function(d){return c(window)._scrollable()};c.fn._scrollable=function(){return this.map(function(){var e=this,d=!e.nodeName||c.inArray(e.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!d){return e}var f=(e.contentWindow||e).document||e.ownerDocument||e;return/webkit/i.test(navigator.userAgent)||f.compatMode=="BackCompat"?f.body:f.documentElement})};c.fn.scrollTo=function(f,e,d){if(typeof e=="object"){d=e;e=0}if(typeof d=="function"){d={onAfter:d}}if(f=="max"){f=9000000000}d=c.extend({},a.defaults,d);e=e||d.duration;d.queue=d.queue&&d.axis.length>1;if(d.queue){e/=2}d.offset=b(d.offset);d.over=b(d.over);return this._scrollable().each(function(){if(f==null){return}var l=this,j=c(l),k=f,i,g={},m=j.is("html,body");switch(typeof k){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(k)){k=b(k);break}k=c(k,this);if(!k.length){return}case"object":if(k.is||k.style){i=(k=c(k)).offset()}}c.each(d.axis.split(""),function(q,r){var s=r=="x"?"Left":"Top",u=s.toLowerCase(),p="scroll"+s,o=l[p],n=a.max(l,r);if(i){g[p]=i[u]+(m?0:o-j.offset()[u]);if(d.margin){g[p]-=parseInt(k.css("margin"+s))||0;g[p]-=parseInt(k.css("border"+s+"Width"))||0}g[p]+=d.offset[u]||0;if(d.over[u]){g[p]+=k[r=="x"?"width":"height"]()*d.over[u]}}else{var t=k[u];g[p]=t.slice&&t.slice(-1)=="%"?parseFloat(t)/100*n:t}if(d.limit&&/^\d+$/.test(g[p])){g[p]=g[p]<=0?0:Math.min(g[p],n)}if(!q&&d.queue){if(o!=g[p]){h(d.onAfterFirst)}delete g[p]}});h(d.onAfter);function h(n){j.animate(g,e,d.easing,n&&function(){n.call(this,k,d)})}}).end()};a.max=function(j,i){var h=i=="x"?"Width":"Height",e="scroll"+h;if(!c(j).is("html,body")){return j[e]-c(j)[h.toLowerCase()]()}var g="client"+h,f=j.ownerDocument.documentElement,d=j.ownerDocument.body;return Math.max(f[e],d[e])-Math.min(f[g],d[g])};function b(d){return typeof d=="object"?d:{top:d,left:d}}})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.