在新版本的jQuery中,您最兴奋的是什么? [英] What are you the most excited about in the new versions of jQuery?

查看:44
本文介绍了在新版本的jQuery中,您最兴奋的是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近发布了一个新的jQuery版本,即jQuery v1.4.您可以在此处阅读所有内容.它可以让您做一些漂亮的事情,例如:

A recent new jQuery version has been released, the jQuery v1.4. You can read all about it here. It allows you to do some pretty neat stuff such as:

$("div.test").bind({
  click: function(){
    $(this).addClass("active");
  },
  mouseenter: function(){
    $(this).addClass("inside");
  },
  mouseleave: function(){
    $(this).removeClass("inside");
  }
});

您最喜欢这个新版本吗?是什么让您最终!"?

添加了赏金,以获得更多反馈并接受答案

推荐答案

我认为最好的功能是允许设置器中的功能:

Best feature in my opinion is allowing functions in setters:

jQuery('li.selected').html(function(i, li) {
   return "<strong>" + li + "</strong>";
});

许多需要$ .each的代码现在可以删除.

A lot of code that required $.each can be removed now.

这篇关于在新版本的jQuery中,您最兴奋的是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆