author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
18 | 1 |
/*! |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
2 |
* jQuery UI Effects Scale 1.13.3 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
3 |
* https://jqueryui.com |
18 | 4 |
* |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
5 |
* Copyright OpenJS Foundation and other contributors |
18 | 6 |
* Released under the MIT license. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
7 |
* https://jquery.org/license |
18 | 8 |
*/ |
9 |
||
10 |
//>>label: Scale Effect |
|
11 |
//>>group: Effects |
|
12 |
//>>description: Grows or shrinks an element and its content. |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
13 |
//>>docs: https://api.jqueryui.com/scale-effect/ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
14 |
//>>demos: https://jqueryui.com/effect/ |
18 | 15 |
|
16 |
( function( factory ) { |
|
19 | 17 |
"use strict"; |
18 |
||
18 | 19 |
if ( typeof define === "function" && define.amd ) { |
20 |
||
21 |
// AMD. Register as an anonymous module. |
|
22 |
define( [ |
|
23 |
"jquery", |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
24 |
"../version", |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
25 |
"../effect", |
18 | 26 |
"./effect-size" |
27 |
], factory ); |
|
28 |
} else { |
|
29 |
||
30 |
// Browser globals |
|
31 |
factory( jQuery ); |
|
32 |
} |
|
19 | 33 |
} )( function( $ ) { |
34 |
"use strict"; |
|
18 | 35 |
|
36 |
return $.effects.define( "scale", function( options, done ) { |
|
37 |
||
38 |
// Create element |
|
39 |
var el = $( this ), |
|
40 |
mode = options.mode, |
|
41 |
percent = parseInt( options.percent, 10 ) || |
|
42 |
( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ), |
|
43 |
||
44 |
newOptions = $.extend( true, { |
|
45 |
from: $.effects.scaledDimensions( el ), |
|
46 |
to: $.effects.scaledDimensions( el, percent, options.direction || "both" ), |
|
47 |
origin: options.origin || [ "middle", "center" ] |
|
48 |
}, options ); |
|
49 |
||
50 |
// Fade option to support puff |
|
51 |
if ( options.fade ) { |
|
52 |
newOptions.from.opacity = 1; |
|
53 |
newOptions.to.opacity = 0; |
|
54 |
} |
|
55 |
||
56 |
$.effects.effect.size.call( this, newOptions, done ); |
|
57 |
} ); |
|
58 |
||
19 | 59 |
} ); |