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 Clip 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: Clip Effect |
|
11 |
//>>group: Effects |
|
12 |
//>>description: Clips the element on and off like an old TV. |
|
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/clip-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 |
], factory ); |
27 |
} else { |
|
28 |
||
29 |
// Browser globals |
|
30 |
factory( jQuery ); |
|
31 |
} |
|
19 | 32 |
} )( function( $ ) { |
33 |
"use strict"; |
|
18 | 34 |
|
35 |
return $.effects.define( "clip", "hide", function( options, done ) { |
|
36 |
var start, |
|
37 |
animate = {}, |
|
38 |
element = $( this ), |
|
39 |
direction = options.direction || "vertical", |
|
40 |
both = direction === "both", |
|
41 |
horizontal = both || direction === "horizontal", |
|
42 |
vertical = both || direction === "vertical"; |
|
43 |
||
44 |
start = element.cssClip(); |
|
45 |
animate.clip = { |
|
46 |
top: vertical ? ( start.bottom - start.top ) / 2 : start.top, |
|
47 |
right: horizontal ? ( start.right - start.left ) / 2 : start.right, |
|
48 |
bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom, |
|
49 |
left: horizontal ? ( start.right - start.left ) / 2 : start.left |
|
50 |
}; |
|
51 |
||
52 |
$.effects.createPlaceholder( element ); |
|
53 |
||
54 |
if ( options.mode === "show" ) { |
|
55 |
element.cssClip( animate.clip ); |
|
56 |
animate.clip = start; |
|
57 |
} |
|
58 |
||
59 |
element.animate( animate, { |
|
60 |
queue: false, |
|
61 |
duration: options.duration, |
|
62 |
easing: options.easing, |
|
63 |
complete: done |
|
64 |
} ); |
|
65 |
||
66 |
} ); |
|
67 |
||
19 | 68 |
} ); |