-1

我正在尝试下面链接中提到的代码。

http://codepen.io/relfor/pen/qKjpL

这在 Chrome 中有效。但不是在FF。知道为什么会这样吗?

注意:我正在尝试使用 MAC FF。

我拥有的FF是最新版本。23.0.1

在此处输入图像描述


为了让它与所有浏览器一起工作,我在下面做了

css

#offerId1 {
    background-position-x:-65px;
    background-position:-65px;
}

javascript

setInterval(function(){
    $('#offerId1').animate(
    {'background-position-x':'300px', 'background-position':'300px'},
    2000,
    function(){
        $('#offerId1').css('background-position-x','-65px');
        $('#offerId1').css('background-position','-65px');
    })}, 1800)
4

1 回答 1

1

Your code is working perfectly it's your css not working try this I have try this hope this work backgroundPositionX not working on Firefox

Try this at js part and you will see it's working

setInterval(function(){
$('button').animate(
  {'background-position-x':'300px'},
  2000,
  function(){
    $('button').css('background-position-x','-65px').css('color','black')

  })}, 1800)

That was just a guideline. This is working see http://codepen.io/arifmahmudrana/pen/Eoefn

于 2013-08-25T11:29:49.527 回答