JQuery Animate Background Image on Y-axis

前端 未结 2 1726
無奈伤痛
無奈伤痛 2020-11-30 08:31

I seem to experiencing a problem with the JQuery animation. I can animate the background image in the positive direction, but not in the negative direction. Any suggestions

2条回答
  •  时光说笑
    2020-11-30 08:58

    @adeneo: this solution only works if you set

    this.x = pos[0].split('px')[0] || 0;
    this.y = pos[1].split('px')[0] || 0;
    

    Otherwise the starting position will be set to zero.

提交回复
热议问题