PageSourceSearch

https://www.sem-ch.jp/themeforest_files/jquery_008.js

js sem-ch.jp collected 2026-10-05 05:14:34 UTC 5,014 bytes, 53 lines download raw bytes

1/*!
2 * jQuery.ScrollTo
3 * Copyright (c) 2007-2012 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
4 * Dual licensed under MIT and GPL.
5 * Date: 4/09/2012
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.3.1
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 */(function(e){function n(e){return typeof e=="object"?e:{top:e,left:e}}var t=e.scrollTo=function(t,n,r){e(window).scrollTo(t,n,r)};t.defaults={axis:"xy",duration:parseFloat(e.fn.jquery)>=1.3?0:1,limit:!0};t.window=function(t){return e(window)._scrollable()};e.fn._scrollable=function(){return this.map(function(){var t=this,n=!t.nodeName||e.
53inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!n)return t;var r=(t.contentWindow||t).document||t.ownerDocument||t;return/webkit/i.test(navigator.userAgent)||r.compatMode=="BackCompat"?r.body:r.documentElement})};e.fn.scrollTo=function(r,i,s){if(typeof i=="object"){s=i;i=0}typeof s=="function"&&(s={onAfter:s});r=="max"&&(r=9e9);s=e.extend({},t.defaults,s);i=i||s.duration;s.queue=s.queue&&s.axis.length>1;s.queue&&(i/=2);s.offset=n(s.offset);s.over=n(s.over);return this._scrollable().each(function(){function h(e){u.animate(l,i,s.easing,e&&function(){e.call(this,r,s)})}if(r==null)return;var o=this,u=e(o),a=r,f,l={},c=u.is("html,body");switch(typeof a){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(a)){a=n(a);break}a=e(a,this);if(!a.length)return;case"object":if(a.is||a.style)f=(a=e(a)).offset()}e.each(s.axis.split(""),function(e,n){var r=n=="x"?"Left":"Top",i=r.toLowerCase(),p="scroll"+r,d=o[p],v=t.max(o,n);if(f){l[p]=f[i]+(c?0:d-u.offset()[i]);if(s.margin){l[p]-=parseInt(a.css("margin"+r))||0;l[p]-=parseInt(a.css("border"+r+"Width"))||0}l[p]+=s.offset[i]||0;s.over[i]&&(l[p]+=a[n=="x"?"width":"height"]()*s.over[i])}else{var m=a[i];l[p]=m.slice&&m.slice(-1)=="%"?parseFloat(m)/100*v:m}s.limit&&/^\d+$/.test(l[p])&&(l[p]=l[p]<=0?0:Math.min(l[p],v));if(!e&&s.queue){d!=l[p]&&h(s.onAfterFirst);delete l[p]}});h(s.onAfter)}).end()};t.max=function(t,n){var r=n=="x"?"Width":"Height",i="scroll"+r;if(!e(t).is("html,body"))return t[i]-e(t)[r.toLowerCase()]();var s="client"+r,o=t.ownerDocument.documentElement,u=t.ownerDocument.body;return Math.max(o[i],u[i])-Math.min(o[s],u[s])}})(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.