PageSourceSearch

https://www.micro-technology.co.jp/assets/js/jquery.easing.1.3.js

js micro-technology.co.jp collected 2026-10-08 07:21:53 UTC 8,432 bytes, 208 lines download raw bytes

vendor: 8,432 bytes, lines 1-208
1/*
2 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
3 *
4 * Uses the built in easing capabilities added In jQuery 1.1
5 * to offer multiple easing options
6 *
7 * TERMS OF USE - jQuery Easing
8 * 
9 * Open source under the BSD License. 
10 * 
11 * Copyright © 2008 George McGinley Smith
12 * All rights reserved.
13 * 
14 * Redistribution and use in source and binary forms, with or without modification, 
15 * are permitted provided that the following conditions are met:
16 * 
17 * Redistributions of source code must retain the above copyright notice, this list of 
18 * conditions and the following disclaimer.
19 * Redistributions in binary form must reproduce the above copyright notice, this list 
20 * of conditions and the following disclaimer in the documentation and/or other materials 
21 * provided with the distribution.
22 * 
23 * Neither the name of the author nor the names of contributors may be used to endorse 
24 * or promote products derived from this software without specific prior written permission.
25 * 
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
27 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
28 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
29 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
31 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
32 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
33 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
34 * OF THE POSSIBILITY OF SUCH DAMAGE. 
35 *
36*/
37
38// t: current time, b: begInnIng value, c: change In value, d: duration
39jQuery.easing['jswing'] = jQuery.easing['swing'];
40
41jQuery.extend( jQuery.easing,
42{
43	def: 'easeOutQuad',
44	swing: function (x, t, b, c, d) {
45		if(typeof jQuery.easing[jQuery.easing.def] == 'function'){
46    	return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
47		}
48		//alert(jQuery.easing.default);
49		//return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
50	},
51	easeInQuad: function (x, t, b, c, d) {
52		return c*(t/=d)*t + b;
53	},
54	easeOutQuad: function (x, t, b, c, d) {
55		return -c *(t/=d)*(t-2) + b;
56	},
57	easeInOutQuad: function (x, t, b, c, d) {
58		if ((t/=d/2) < 1) return c/2*t*t + b;
59		return -c/2 * ((--t)*(t-2) - 1) + b;
60	},
61	easeInCubic: function (x, t, b, c, d) {
62		return c*(t/=d)*t*t + b;
63	},
64	easeOutCubic: function (x, t, b, c, d) {
65		return c*((t=t/d-1)*t*t + 1) + b;
66	},
67	easeInOutCubic: function (x, t, b, c, d) {
68		if ((t/=d/2) < 1) return c/2*t*t*t + b;
69		return c/2*((t-=2)*t*t + 2) + b;
70	},
71	easeInQuart: function (x, t, b, c, d) {
72		return c*(t/=d)*t*t*t + b;
73	},
74	easeOutQuart: function (x, t, b, c, d) {
75		return -c * ((t=t/d-1)*t*t*t - 1) + b;
76	},
77	easeInOutQuart: function (x, t, b, c, d) {
78		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
79		return -c/2 * ((t-=2)*t*t*t - 2) + b;
80	},
81	easeInQuint: function (x, t, b, c, d) {
82		return c*(t/=d)*t*t*t*t + b;
83	},
84	easeOutQuint: function (x, t, b, c, d) {
85		return c*((t=t/d-1)*t*t*t*t + 1) + b;
86	},
87	easeInOutQuint: function (x, t, b, c, d) {
88		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
89		return c/2*((t-=2)*t*t*t*t + 2) + b;
90	},
91	easeInSine: function (x, t, b, c, d) {
92		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
93	},
94	easeOutSine: function (x, t, b, c, d) {
95		return c * Math.sin(t/d * (Math.PI/2)) + b;
96	},
97	easeInOutSine: function (x, t, b, c, d) {
98		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
99	},
100	easeInExpo: function (x, t, b, c, d) {
101		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
102	},
103	easeOutExpo: function (x, t, b, c, d) {
104		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
105	},
106	easeInOutExpo: function (x, t, b, c, d) {
107		if (t==0) return b;
108		if (t==d) return b+c;
109		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
110		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
111	},
112	easeInCirc: function (x, t, b, c, d) {
113		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
114	},
115	easeOutCirc: function (x, t, b, c, d) {
116		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
117	},
118	easeInOutCirc: function (x, t, b, c, d) {
119		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
120		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
121	},
122	easeInElastic: function (x, t, b, c, d) {
123		var s=1.70158;var p=0;var a=c;
124		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
125		if (a < Math.abs(c)) { a=c; var s=p/4; }
126		else var s = p/(2*Math.PI) * Math.asin (c/a);
127		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
128	},
129	easeOutElastic: function (x, t, b, c, d) {
130		var s=1.70158;var p=0;var a=c;
131		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
132		if (a < Math.abs(c)) { a=c; var s=p/4; }
133		else var s = p/(2*Math.PI) * Math.asin (c/a);
134		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
135	},
136	easeInOutElastic: function (x, t, b, c, d) {
137		var s=1.70158;var p=0;var a=c;
138		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
139		if (a < Math.abs(c)) { a=c; var s=p/4; }
140		else var s = p/(2*Math.PI) * Math.asin (c/a);
141		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
142		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
143	},
144	easeInBack: function (x, t, b, c, d, s) {
145		if (s == undefined) s = 1.70158;
146		return c*(t/=d)*t*((s+1)*t - s) + b;
147	},
148	easeOutBack: function (x, t, b, c, d, s) {
149		if (s == undefined) s = 1.70158;
150		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
151	},
152	easeInOutBack: function (x, t, b, c, d, s) {
153		if (s == undefined) s = 1.70158; 
154		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
155		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
156	},
157	easeInBounce: function (x, t, b, c, d) {
158		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
159	},
160	easeOutBounce: function (x, t, b, c, d) {
161		if ((t/=d) < (1/2.75)) {
162			return c*(7.5625*t*t) + b;
163		} else if (t < (2/2.75)) {
164			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
165		} else if (t < (2.5/2.75)) {
166			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
167		} else {
168			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
169		}
170	},
171	easeInOutBounce: function (x, t, b, c, d) {
172		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
173		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
174	}
175});
176
177/*
178 *
179 * TERMS OF USE - EASING EQUATIONS
180 * 
181 * Open source under the BSD License. 
182 * 
183 * Copyright © 2001 Robert Penner
184 * All rights reserved.
185 * 
186 * Redistribution and use in source and binary forms, with or without modification, 
187 * are permitted provided that the following conditions are met:
188 * 
189 * Redistributions of source code must retain the above copyright notice, this list of 
190 * conditions and the following disclaimer.
191 * Redistributions in binary form must reproduce the above copyright notice, this list 
192 * of conditions and the following disclaimer in the documentation and/or other materials 
193 * provided with the distribution.
194 * 
195 * Neither the name of the author nor the names of contributors may be used to endorse 
196 * or promote products derived from this software without specific prior written permission.
197 * 
198 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
199 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
200 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
201 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
202 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
203 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
204 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
205 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
206 * OF THE POSSIBILITY OF SUCH DAMAGE. 
207 *
208 */

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.