blob: 0e558201e8846bdbe82a00cfa6dc3928634d3c17 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
<p>The jQuery UI effects core extends the <a href="http://docs.jquery.com/Effects/animate" title="Effects/animate">animate</a> function to be able to animate colors as well. It's heavily used by the class transition feature and it's able to color animate the following properties:
</p>
<ul><li> <b>backgroundColor</b>
</li><li> <b>borderBottomColor</b>
</li><li> <b>borderLeftColor</b>
</li><li> <b>borderRightColor</b>
</li><li> <b>borderTopColor</b>
</li><li> <b>color</b>
</li><li> <b>outlineColor</b>
</li></ul>
<p>with one of the following combinations:
</p>
<ul><li> <b>hex (#FF0000)</b>
</li><li> <b>rgb (rgb(255,255,255))</b>
</li><li> <b>names ("black")</b>
</li></ul>
<p><br />
</p><p><div class="options list"><table class="options examples" cellspacing="0"><thead><tr><th>Name</th><th>Type</th></tr></thead><tbody>
</table><b class="options">Example:</b><table class="options examples" cellspacing="0"><thead><tr><th>Name</th><th>Type</th></tr></thead><tbody>
<div class="example">
<ul><li><a href="#demo"><span>Demo</span></a></li><li><a href="#source"><span>View Source</span></a></li></ul>
<div id="demo" class="tabs-container" rel="125">
A simple color animation.<br />
</p>
<pre>$(".block").<a href="http://docs.jquery.com/Events/toggle" title="Events/toggle">toggle</a>(function() {
$(this).<a href="http://docs.jquery.com/Effects/animate" title="Effects/animate">animate</a>({ backgroundColor: "black" }, 1000);
},function() {
$(this).<a href="http://docs.jquery.com/Effects/animate" title="Effects/animate">animate</a>({ backgroundColor: "#68BFEF" }, 500);
});
</pre>
<p></div><div id="source" class="tabs-container">
</p>
<pre><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<a href="http://www.w3.org/TR/html4/loose.dtd" class="external free" title="http://www.w3.org/TR/html4/loose.dtd">http://www.w3.org/TR/html4/loose.dtd</a>">
<html>
<head>
<script src="<a href="http://code.jquery.com/jquery-latest.js" class="external free" title="http://code.jquery.com/jquery-latest.js">http://code.jquery.com/jquery-latest.js</a>"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script>
$(document).ready(function(){
$(".block").<a href="http://docs.jquery.com/Events/toggle" title="Events/toggle">toggle</a>(function() {
$(this).<a href="http://docs.jquery.com/Effects/animate" title="Effects/animate">animate</a>({ backgroundColor: "black" }, 1000);
},function() {
$(this).<a href="http://docs.jquery.com/Effects/animate" title="Effects/animate">animate</a>({ backgroundColor: "#68BFEF" }, 500);
});
});
</script>
<style>
.block {
color: white;
background-color: #68BFEF;
width: 150px;
height: 70px;
margin: 10px;
}
</style>
</head>
<body>
<div class="block"> Click me</div>
</body>
</html>
</pre>
<p></div>
</p><p></div>
</p><p></tbody></table></div>
</p><!--
Pre-expand include size: 3730 bytes
Post-expand include size: 5382 bytes
Template argument size: 3450 bytes
Maximum: 2097152 bytes
-->
<!-- Saved in parser cache with key jqdocs_docs:pcache:idhash:3094-1!1!0!!en!2 and timestamp 20101025190223 -->
|