jquery函数
1,after(html) after(elem) after(elems)将指定的元素插入到某元素后。
before(html) before(elem) before(elems)与之相反
2,append(html) append(elem) append(elems)
将指定的元素插入到某元素内部的末尾位置
appendTo与之相反,但似乎只能使用appendTo(elem)
3,prepend (html) prepend (elem) prepend (elems)
将指定的元素插入到某元素内部的开始位置,注意与append的区别
4,wrap(htm)
将匹配对象包含在给出的html代码内
5,next
<script type="text/javascript">
$(document).ready(function() {
$('#t').find('dd').end().find('dt').click(function() {
$(this).next().css("background","#f00");
});
});
</script>
<dl id="t">
<dt>点这里测试1?</dt>
<dd>1111111111111111</dd>
<dt>点这里测试2?</dt>
<dd>2222222222222222</dd>
</dl>
http://tzangms.com/blog/programming/984
http://www.blogjava.net/wangxinsh55/archive/2007/06/25/126166.html
6,深度,递归式的 .extend()
新的extend()允许你更深度的合并镶套对象。下面的例子是一个很好的证明。
// 以前的 .extend()
jQuery.extend(
{ name: “John”, location: { city: “Boston” } },
{ last: “Resig”, location: { state: “MA” } }
);
// 结果:
// => { name: “John”, last: “Resig”, location: { state: “MA” } }
// 新的更深入的 .extend()
jQuery.extend( true,
{ name: “John”, location: { city: “Boston” } },
{ last: “Resig”, location: { state: “MA” } }
);
// 结果
// => { name: “John”, last: “Resig”,
// location: { city: “Boston”, state: “MA” } }
7,1.2.3版本和1.2.1版本的remove方法的区别
1.2.1版本
<div class="sourceRow">remove: function(a){
页:
[1]