forked from RubyLouvre/mass-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfn.prependTo.html
75 lines (70 loc) · 2.75 KB
/
fn.prependTo.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
<!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.prependTo</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.prependTo( content )</h3>
<p>
<span class="stress">描述:</span>
</p>
<p>这里涉及两个dom对象,如果content不为dom对象将会被转换为dom对象。 相当dom1.prependTo(dom2)。然后进行反转操作,转换为dom2.prepend(dom1),再返回dom2。</p>
<p>
<span class="stress">参数:</span>
</p>
<dl>
<dt>content</dt>
<dd>必需,可以为元素节点,符合套嵌关系的HTML片断,CSS选择器或dom对象。</dd>
</dl>
<p>
<span class="stress">返回值:</span>
</p>
<p>原mass实例</p>
<fieldset>
<legend>例子</legend>
<table class="table1">
<tbody>
<tr>
<td>append</td>
<td>appendTo</td>
</tr>
<tr>
<td>prepend</td>
<td>prependTo</td>
</tr>
<tr>
<td>before</td>
<td>insertBefore</td>
</tr>
<tr>
<td>after</td>
<td>insertAfter</td>
</tr>
</tbody>
</table>
<pre class="brush:xml;gutter:false;toolbar:false">
<table class="table1">
<tbody>
<tr><td>append</td><td>appendTo</td></tr>
<tr><td>prepend</td><td>prependTo</td></tr>
<tr><td>before</td><td>insertBefore</td></tr>
<tr><td>after</td><td>insertAfter</td></tr>
</tbody>
</table>
</pre>
<pre class="brush:javascript;gutter:false;toolbar:false">
$("<thead><th>正向插入</th><th>反向插入</th></thead>").prependTo(".table1");
</pre>
<button class="doc_btn" type="button">点我,执行代码</button>
</fieldset>
</article>
</body>
</html>