Chen Yangjian's Blog

Carpe diem - Seize the day

jQuery 1.3.2 发布

| Comments

与 1.3.1 主要的改变有:

  • Elements Returned in Document Order. 似乎是为了跟内部其他部件好交流,按照选择器 API 做出的更改, 我表示这个变更对我影响不大。
  • .live() Can Now Prevent Bubbling. 两个 live 的元素可以嵌套,通过返回假或者调用阻止函数终止事件触发。 1.3.1 的时候我就用到了一哈 live,还是挺方便的。(For those wondering about the, currently missing, features of .live() (like submit and change events) you can expect all of those to land in jQuery 1.3.3, due to arrive sometime next month.) 想要 submit 与 change 之类的事件类型也能 live?等下一个版本吧。
  • :visible/:hidden Overhauled. 判断方法的改变,我再度表示对生活影响不大。 原来是判断一坨东西,现在只看元素的宽度与高度偏移,有的话就不认为是隐藏的。效率提升咣咣的。
  • .height()/.width() Overhauled. 同样是速度提升。
  • Selector Speed-up in IE. 据说在 IE 里头的提升尤其明显。
  • .appendTo()/etc. Now Return Inserted Elements. appendTo() 返回的不再是传递进去被操作的变量而已,而是实际插入到 DOM 中的元素。具体请看:

This was due to the fact that .appendTo, etc. would only return the elements that were passed in to it, instead of the elements that were actually inserted (and since only a single paragraph was passed in - the first one to be inserted - only the first paragraph had the class added to it).

Comments