0

i'm using a plugin by Alexander Farkas which animates backgrounds really nicely.

And it works fine even in IE9, but in IE8 and IE7 gives me this error: 'SCRIPT5007: Unable to get value of the property 'replace': object is null or undefined'

Somehow in IE8 he cant transform the values (by values i mean the pixels) given to the function...

Could somebody have a look? i didn't want to post the hole js but you can check it out here:

http://factorystore.hu/test/

Thanks in advance

4

1 に答える 1

0

make sure there will be no trailing comma's IE doesn't like trailing commas in arrays/objects.

check these two lines

start = toArray(start);
 var end = toArray(fx.end);

Updated Solutions

paste this code

if(!document.defaultView || !document.defaultView.getComputedStyle){ // IE6-IE8
        var oldCurCSS = jQuery.curCSS;
        jQuery.curCSS = function(elem, name, force){
            if(name === 'background-position'){
                name = 'backgroundPosition';
            }
            if(name !== 'backgroundPosition' || !elem.currentStyle || elem.currentStyle[ name ]){
                return oldCurCSS.apply(this, arguments);
            }
            var style = elem.style;
            if ( !force && style && style[ name ] ){
                return style[ name ];
            }
            return oldCurCSS(elem, 'backgroundPositionX', force) +' '+ oldCurCSS(elem, 'backgroundPositionY', force);
        };
    }

above this line

$.extend($.fx.step,{
于 2012-10-17T11:18:16.457 に答える