forked from pandoraui/jquery-chm
-
Notifications
You must be signed in to change notification settings - Fork 3
/
css.html
82 lines (81 loc) · 4.14 KB
/
css.html
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
79
80
81
82
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>css(name|pro|[,val|fn]) | jQuery API 中文手册</title>
<meta name="author" content="jQuery 中文手册 - hemin.cn/jq/">
<meta name="description" content="访问匹配元素的样式属性。jQuery 1.8中,当你使用CSS属性在css()或animate()中,我们将根据浏览器自动加上前缀(在适当的时候),比如('user-select', 'none'); 在Chrome/Safari浏览器中我们将设置为'-webkit-user-select', Firefox会使用'-moz-user-select', IE10将使用'-ms-user-select'。 - jQuery API 中文手册">
<meta name="keywords" content="jquery,chm,手册,在线,api" />
<link type="image/x-icon" href="img/favicon.ico" rel="shortcut icon">
<link type="text/css" rel="stylesheet" href="style/style.css" />
</head>
<body id="split">
<div id='left' class='dtree'>
<p style="text-align:center">
<input type="text" name="query" id="query" placeholder="请输入关键字"/>
<!--<input type="button" id="butsoso" value="搜索" />--></p>
<p style="margin:7px 0; text-align:center"><a href="javascript:void(0)" id="openAll">全部展开</a> | <a href="javascript:void(0)" id="closeAll">全部折叠 </a> | <a href="index.html">速查表</a></p>
<div id="menu">
</div>
</div>
<div id="content" class="a2">
<div rel="css">
<h2><span>返回值:String</span>css(name|pro|[,val|fn])</h2>
<h3>概述</h3>
<div class="desc">
<p>访问匹配元素的样式属性。</p>
<div class="longdesc">
<p>jQuery 1.8中,当你使用CSS属性在<a href="css.html">css()</a>或<a href="animate.html">animate()</a>中,我们将根据浏览器自动加上前缀(在适当的时候),比如("user-select", "none"); 在Chrome/Safari浏览器中我们将设置为"-webkit-user-select", Firefox会使用"-moz-user-select", IE10将使用"-ms-user-select".</p>
</div>
</div>
<h3>参数</h3>
<div class="parameter">
<h4><strong>name</strong><span>String</span><em>V1.0</em></h4>
<p>要访问的属性名称</p>
<h4><strong>name</strong><span>Array</span><em>V1.9</em></h4>
<p>一个或多个CSS属性组成的一个数组</p>
<h4><strong>properties</strong><span>Map</span><em>V1.0</em></h4>
<p>要设置为样式属性的名/值对</p>
<h4><strong>name,value</strong><span>String, Number</span><em>V1.4</em></h4>
<p>属性名,属性值</p>
<h4><strong>name,function(index, value)</strong><span>String,Function</span><em>V1.0</em></h4>
<p>1:属性名</p>
<p>2:此函数返回要设置的属性值。接受两个参数,index为元素在对象集合中的索引位置,value是原先的属性值。</p>
</div>
<div class="example">
<h3>示例</h3>
<span id="f_ad2"></span>
<h4>参数name 描述:</h4>
<p>取得第一个段落的color样式属性的值。</p>
<h5>jQuery 代码:</h5>
<pre><code>$("p").css("color");</code></pre>
<h4>参数properties 描述:</h4>
<p>将所有段落的字体颜色设为红色并且背景为蓝色。</p>
<h5>jQuery 代码:</h5>
<pre><code>$("p").css({ "color": "#ff0011", "background": "blue" });</code></pre>
<h4>参数name,value 描述:</h4>
<p>将所有段落字体设为红色</p>
<h5>jQuery 代码:</h5>
<pre><code>$("p").css("color","red");</code></pre>
<h4>参数name,回调函数 描述:</h4>
<p>逐渐增加div的大小</p>
<h5>jQuery 代码:</h5>
<pre><code> $("div").click(function() {
$(this).css({
width: function(index, value) {
return parseFloat(value) * 1.2;
},
height: function(index, value) {
return parseFloat(value) * 1.2;
}
});
});</code></pre>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.autocomplete.js"></script>
<script type="text/javascript" src="js/dtree.js"></script>
<script type="text/javascript" src="js/js.js"></script>
</html>