Skip to content

Commit 40dbbb1

Browse files
committed
Entries: Document cssClip method
Includes example for animating clip, adds <added> entry for transfer method. Ref gh-242 Closes gh-267
1 parent e5dd858 commit 40dbbb1

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

entries/cssClip.xml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0"?>
2+
<entry name="cssClip" type="method" return="jQuery">
3+
<title>.cssClip()</title>
4+
<desc>Getter/setter for an object version of the CSS <code>clip</code> property.</desc>
5+
<added>1.12</added>
6+
<signature>
7+
<argument name="dimensions" type="Object" optional="true">
8+
<desc>When setting the CSS <code>clip</code> property, specify the <code>top</code>, <code>right</code>, <code>bottom</code> and <code>left</code>, properties to use the <code>rect()</code> style.</desc>
9+
</argument>
10+
</signature>
11+
<example>
12+
<height>175</height>
13+
<css><![CDATA[
14+
.clipped {
15+
position: absolute;
16+
width: 150px;
17+
height: 150px;
18+
background: #3b679e;
19+
background: linear-gradient(to bottom, #3b679e 0%, #2b88d9 50%, #207cca 51%, #7db9e8 100%);
20+
}
21+
]]></css>
22+
<code><![CDATA[
23+
var clippings = [
24+
{
25+
top: 10,
26+
right: 50,
27+
bottom: 50,
28+
left: 5
29+
},
30+
{
31+
top: 0,
32+
right: 150,
33+
bottom: 150,
34+
left: 0
35+
}
36+
];
37+
var index = 1;
38+
var box = $( ".clipped" ).cssClip( clippings[ 0 ] );
39+
40+
$( document ).click(function() {
41+
box.animate( {
42+
clip: clippings[ index++ % 2 ]
43+
}, 2000 );
44+
});
45+
46+
]]></code>
47+
<html><![CDATA[
48+
Click anywhere!
49+
<div class="clipped"></div>
50+
]]></html>
51+
</example>
52+
<category slug="methods"/>
53+
<category slug="overrides"/>
54+
<category slug="utilities"/>
55+
<category slug="effects"/>
56+
<category slug="effects-core"/>
57+
</entry>

entries/transfer.xml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<p>Very useful when trying to visualize interaction between two elements.</p>
77
<p>The transfer element itself has the class <code>ui-effects-transfer</code>, and needs to be styled by you, for example by adding a background or border.</p>
88
</longdesc>
9+
<added>1.12</added>
910
<signature>
1011
<argument name="options" type="Object">
1112
<property name="to" type="Selector">

0 commit comments

Comments
 (0)