forked from RubyLouvre/mass-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfn.prev.html
68 lines (63 loc) · 2.25 KB
/
fn.prev.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<title>$.fn.prev</title>
<script>
window.$$path = location.protocol + "//" + location.host;
document.write('<script src="' + $$path + '/mass_merge.js"><\/script>')
document.write('<script src="' + $$path + '/doc/scripts/common.js"><\/script>')
</script>
</head>
<body>
<article>
<h3>$.fn.prev([ expr ])</h3>
<p>
<span class="stress">描述:</span>
</p>
<p>把匹配元素的与之毗邻的上一个元素节点收集起来,去重排序组成新mass实例返回。</p>
<p>
<span class="stress">参数:</span>
</p>
<dl>
<dt>expr</dt>
<dd>可选,String,用于进一步过滤的CSS选择器。</dd>
</dl>
<p>
<span class="stress">返回值:</span>
</p>
<p>新mass实例</p>
<fieldset>
<legend>例子</legend>
<p>将.third-item的上一个LI元素的背景变红。</p>
<ul>
<li>list item 0</li>
<li>list item 1</li>
<li>list item 2</li>
<li class="third-item">list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
<li>list item 6</li>
</ul>
<pre class="brush:xml;gutter:false;toolbar:false">
<ul>
<li>list item 0</li>
<li>list item 1</li>
<li>list item 2</li>
<li class="third-item">list item 3</li>
<li>list item 4</li>
<li>list item 5</li>
<li>list item 6</li>
</ul>
</pre>
<pre class="brush:javascript;gutter:false;toolbar:false">
$.require("ready,node", function() {
$(".third-item").prev().css("background-color", "red");
});
</pre>
<button class="doc_btn" type="button">点我,执行代码</button>
</fieldset>
</article>
</body>
</html>