我想知道是否有人可以为我提供我的代码的优化版本,因为我意识到它倾向于在Windows下ie6中运行得非常慢。我觉得我读的地方,使用.bind()在我的代码click事件会有所帮助,但我不知道如何去了解它...如何优化我的jQuery以获得最佳性能?
下面是相关的javascript:
var buttonToGlow = $(".buttonGlow");
buttonToGlow.effect("pulsate", {}, 850);
$(".buttonGlow").hover(function(){
$(this).filter(':not(:animated)').effect("pulsate", {times:1}, 350);
});
$(".buttonGlow").each(function(){
var currentTitle = $(this).attr("title");
$(this).click(function() {
TINY.box.show({html:''+ currentTitle +''});
});
});
这里是我放在一起的link to the test page。
感谢您的帮助!
究竟是什么慢?动画? – Olegas 2011-04-13 12:06:11
在IE6下的最佳优化:安装IE9 ... – Martijn 2011-04-13 12:08:49
无论如何,与现代浏览器相比,IE6的速度非常慢。看过你的代码后,你无法用它做任何事情。 – JohnP 2011-04-13 12:10:13