慢jQuery的动画在IE浏览器 [英] Slow jQuery animation in IE
问题描述
我有一个网站 http://www.special4you.co.uk 并具有动画导航从气罐。这个工程在FF和铬可爱的外表,但在所有的独立实体,它看起来裤子动画差,参差不齐。有谁知道为什么,或者如果它是我的错?
我的code是:
$(文件)。就绪(函数(){
Cufon.replace(H1,P,#address,H2');
$(气球导航)。悬停(函数(hoverEvent){
$(a.balloon-NAV)。点击(函数(clickEvent,hoverEvent){
clickEvent.stopPropagation();
VAR元= $(本);
VAR的目标= element.attr(HREF);
VAR zIndex的= element.css(Z-指数);
element.attr(的href,#)的CSS(z索引,100)。
element.animate({顶:0},1500,easeOutBounce',函数(){
element.css(Z-指数,zIndex的);
window.location的=目标;
});
});
变种E =这一点;
$(E).animate({marginTop:-14px},250,函数(){
$(E).animate({marginTop:-10px},250);
});
},功能(){
变种E =这一点;
$(E).animate({marginTop:4PX},250,函数(){
$(E).animate({marginTop:0像素},250);
});
});
});
这是不是你的错,IE浏览器是缓慢的,你必须与活到微软确实它的东西。
这是因为你对CSS的变化很多的在少量时间,也许如果您降低IE浏览器的更新可能有帮助的数额运行速度慢。
I have a site http://www.special4you.co.uk and has a animation nav made from balloons. This works and looks lovely in FF and Chrome but in all the IEs it looks pants as the animation is poor and jagged. Does anyone know why this or if it is my fault?
my code is:
$(document).ready(function(){
Cufon.replace('h1, p, #address, h2');
$(".balloon-nav").hover(function(hoverEvent) {
$("a.balloon-nav").click(function(clickEvent, hoverEvent){
clickEvent.stopPropagation();
var element = $(this);
var target = element.attr("href");
var zIndex = element.css("z-index");
element.attr("href", "#").css("z-index", "100");
element.animate({ top: "0" }, 1500, 'easeOutBounce', function() {
element.css("z-index", zIndex);
window.location=target;
});
});
var e = this;
$(e).animate({ marginTop: "-14px" }, 250, function() {
$(e).animate({ marginTop: "-10px" }, 250);
});
},function(){
var e = this;
$(e).animate({ marginTop: "4px" }, 250, function() {
$(e).animate({ marginTop: "0px" }, 250);
});
});
});
This isn't your fault, Internet Explorer is slow, you'll have to live with that until Microsoft does something about it.
It runs slow because you have lot's of CSS changes in a small amount of time, maybe if you lower the amount of updates for IE it might help.
这篇关于慢jQuery的动画在IE浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!