I've been developing my website in both Firefox and IE 8. There's an image hover effect on the main page (as well as in the photography and drawing sections). You can see the code in the source at <a href="http://www.dgendill.com" rel="nofollow noreferrer">http://www.dgendill.com</a>. In Firefox, the effect works perfect. In IE 8, it works, but it's much, much slower. Here's what I've tried to improve the speed:
<ol>
<li>Used the optimized jQuery library</li>
<li>Narrowed the scope with which jQuery traverses the DOM. For instance:
</li>
<li>I've tried changing the display type of the image. Display block, inline-block, and inline.</li>
</ol>
Any ideas why IE 8 is so much slower? My HTML is valid 4.01.
Here's a guy that's worked with the same problem:
<a href="http://mdasblog.wordpress.com/2009/07/24/jquery-fun-with-animation-and-opacity/" rel="nofollow noreferrer">http://mdasblog.wordpress.com/2009/07/24/jquery-fun-with-animation-and-opacity/</a>
I've decided to just disable the hover effect in IE.
<ol>
<li>Used the optimized jQuery library</li>
<li>Narrowed the scope with which jQuery traverses the DOM. For instance:
Code:
$(".sectionLink","#divLandingPage").hover(
function(){
$(this).addClass("hover");
$(this).fadeTo(100,.8);
},
function(){
$(this).removeClass("hover");
$(this).fadeTo(100,.99);
}
);
<li>I've tried changing the display type of the image. Display block, inline-block, and inline.</li>
</ol>
Any ideas why IE 8 is so much slower? My HTML is valid 4.01.
Here's a guy that's worked with the same problem:
<a href="http://mdasblog.wordpress.com/2009/07/24/jquery-fun-with-animation-and-opacity/" rel="nofollow noreferrer">http://mdasblog.wordpress.com/2009/07/24/jquery-fun-with-animation-and-opacity/</a>
I've decided to just disable the hover effect in IE.
Code:
if(jQuery.support.opacity) {
$(".sectionLink","#divLandingPage").hover(
function(){
$(this).addClass("hover");
$(this).fadeTo(100,.8);
},
function(){
$(this).removeClass("hover");
$(this).fadeTo(100,.99);
}
);
}