views:

37

answers:

1

I'm tired of setting background-position-x with IE, $('.scroller').css('background-position-x', posX+'px'); is not woking, any other methods

var posX = $('.scroller').css('background-position');
    if(typeof(posX) === 'undefined')
    {
        posX = $(' .scroller').css('background-position-x');
    }
    posX = posX.split(" ",1);
    posX = parseInt(posX,10);

    posX = (posX > 100 ) ? 0 : posX+1;
    if(isIE()){
        $('.scroller').css('background-position-x', posX+'px');
    } else {
        $('.scroller').css('background-position', posX+'px center');
    }
+1  A: 

In IE8 standards mode, you have to call it "-ms-background-position-x".

Pointy