backgroundPosition issue in IE8

backgroundPosition issue in IE8

I need help with an IE8 problem.  I apologize for the long post but I want to give as many facts as possible.


Please reference: www.banana-digital.com


I have already banned less than IE8 from my site but have the following problem with IE8 only (works on Mac and Win in these "allowed" browsers: Safari 5+, Chrome, FF 3.5+ and Opera 10+):


var element = $("#whatever");
var showOverClosed = "0px -13800px";
element.css({backgroundPosition: showOverClosed});



I use the backgroundPosition setter / getter extensively in this animation-extensive site.  

But it breaks in IE8.

I did hack this as the only way I could get IE8 to work in a frame animation algorithm, noting that I have to test for browser and version (ugh) and then use this getter:


element.css('background-position-x');


The following is an example that appears to work but seems unstable to me: (note that "accordionState" references an object within a data store attached to the "page" element):


if (accordionState.browserWorking == "ie") {
  if (accordionState.browserMajorVersion < 9) {
   bgPosY = parseInt(element.css('background-position-y'));
  }
 }
 else {
  bgPos = element.css('backgroundPosition');
  bgPosSplit = bgPos.split(' ');
  bgPosY = parseInt(bgPosSplit[1]);
 } 

There are many other cases where I have get or set backgroundPosition, especially in the 'over' and out' functions where I use hoverIntent.

As a great fan and user of jQuery, I am puzzled that this will not work in IE8.  Note that backgroundColor does not work either, although I do use UI to do these sorts of things and it seems to work in IE.