RSS
热门关键字:  css  jquery  select input  asp jquery  用户注册
当前位置 :| 主页>业内新闻>

jQuery-1.2.6新特性及主要改变

来源: 作者:snake 时间:2008-07-03 Tag: 点击:
性能提升我就不说了, 这可以查看

1、整合了Dimensions Plugin插件

2、消除.attr()方法的15个明显错误并优化了该方法

3、.toggle()方法中现在可以地增加了不止两个方法如:     

$("div").toggle(function(){
    $(this).removeClass("three").addClass("one");
}, function(){
    $(this).removeClass("one").addClass("two");
}, function(){
    $(this).removeClass("two").addClass("three");
});
4、可以对toggle()和one()方法进行解除绑定
function test(){ $(this).addClass("test"); }
$("div").one("click", test);
$("div").unbind("click", test);

$("div").toggle(test, test);
$("div").unbind("click", test);

5、index()现在可用于检索一个jQuery对像在集合中的索引
var test = $("div.test");
$("div").index( test ) == 3

6、makeArray()可以把任何对像转换为数组
jQuery.makeArray( document.getElementsByTagName("div") )
// => [ div, div, div ]

jQuery.makeArray( true )
// => [ true ]

jQuery.makeArray()
// => []
7、beforeSend 的使用可以在ajax调用之前处理一些代码来决定是否进行ajax调用
$.ajax({
  beforeSend: function(){
    return $("#input").val() == "";
  },
  url: "test.php"
});


8、公开速度对像,可以通过更改jQuery.fx.speeds对像来对覆盖默认值,也可以新添自已的速度常数。

jQuery.fx.speeds.slow = 1000;
$("#test").slideDown("slow");


最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
热点关注