I can't bealieve i found something that works both in IE8 and IE7 but fails in IE9. Here is the page i was working on: [Link to the site][1]. Notice how in IE9, on the side menu when hover a link the browser resets the background to background-position: 0 0
and only after this applys, the script animates it to background-position: -20px 0
(where i want it to go in the first place). Is anything that i've done wrong or there is a IE bug? Also need some help to fix it.
here is the script that i am applaying to IE brawsers only:
**
$('#nav_bar li')
.css( {backgroundPositionX:"-224px",
backgroundPositionY:"0px"} )
.mouseenter(function(){
$(this).stop().animate(
{backgroundPositionX:"-20px"},
{duration:550})
})
.mouseleave(function(){
$(this).stop().animate(
{backgroundPositionX:"-224px",
backgroundPositionY:"0px"},
{duration:550})
})
Thanks for the help!
[1]:
Might I suggest the following CSS-only solution?
If you really want it to work in IE9 and below (since it does work fine in IE10), try animating
backgroundPosition
itself, rather than its component properties.