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 Blind 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: Blind Effect |
|
11 |
//>>group: Effects |
|
12 |
//>>description: Blinds the element. |
|
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/blind-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( "blind", "hide", function( options, done ) { |
|
36 |
var map = { |
|
37 |
up: [ "bottom", "top" ], |
|
38 |
vertical: [ "bottom", "top" ], |
|
39 |
down: [ "top", "bottom" ], |
|
40 |
left: [ "right", "left" ], |
|
41 |
horizontal: [ "right", "left" ], |
|
42 |
right: [ "left", "right" ] |
|
43 |
}, |
|
44 |
element = $( this ), |
|
45 |
direction = options.direction || "up", |
|
46 |
start = element.cssClip(), |
|
47 |
animate = { clip: $.extend( {}, start ) }, |
|
48 |
placeholder = $.effects.createPlaceholder( element ); |
|
49 |
||
50 |
animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ]; |
|
51 |
||
52 |
if ( options.mode === "show" ) { |
|
53 |
element.cssClip( animate.clip ); |
|
54 |
if ( placeholder ) { |
|
55 |
placeholder.css( $.effects.clipToBox( animate ) ); |
|
56 |
} |
|
57 |
||
58 |
animate.clip = start; |
|
59 |
} |
|
60 |
||
61 |
if ( placeholder ) { |
|
62 |
placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing ); |
|
63 |
} |
|
64 |
||
65 |
element.animate( animate, { |
|
66 |
queue: false, |
|
67 |
duration: options.duration, |
|
68 |
easing: options.easing, |
|
69 |
complete: done |
|
70 |
} ); |
|
71 |
} ); |
|
72 |
||
19 | 73 |
} ); |