jQuery动画无法在Safari中使用 [英] jQuery animate not working on safari

查看:86
本文介绍了jQuery动画无法在Safari中使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个动画div的jQuery代码. 它可以在Firefox和Chrome上完美运行,但在野生动物园中它不会移动,只是在旋转,而在Internet Explorer中,它却没有旋转! 任何解决此问题的想法都将受到赞赏.

I have this jQuery code which animates a div. It works perfectly on Firefox and Chrome, but in safari it doesn't move, it is just rotating, and in internet explorer it moves without rotating! any idea on solving this is appreciated.

jQuery:

$(document).ready(function()
{   
  $(".plane").animate({
    'top':'-=0px',
    'left':'+=0px',
    rotate:-50
    }, 500, 'swing');

  $(".plane").animate({
    'top':'-=35px',
    'left':'+=590px',
    rotate:-60
    }, 7000, 'easeOutQuart');

  $(".plane").animate({
    'top':'-=0px',
    'left':'+=0px',
    rotate:25
    }, 2000, 'swing');

  $(".plane").animate({
    'top':'+=30px',
    'left':'+=10px',
    rotate:20
    }, 2000, 'easeInOutCubic');

  $(".plane").animate({
    'top':'-=0px',
    'left':'+=0px',
    rotate:10
    }, 1000, 'swing');

  $(".plane").animate({
    'top':'+=270px',
    'left':'+=180px',
    rotate:0
    }, 5000, 'easeInOutCubic');

  $(".plane").animate({
    'top':'-=0px',
    'left':'+=0px',
    rotate:-130
    }, 1000, 'swing');

  $(".plane").animate({
    'top':'-=490px',
    'left':'+=60px',
    rotate:-120
    }, 5000, 'easeInOutCubic');

  $(".plane").animate({
    'top':'-=0px',
    'left':'+=0px',
    rotate:-250
    }, 1000, 'swing');

  $(".plane").animate({
    'top':'+=150px',
    'left':'-=200px',
    rotate:-270
    }, 5000, 'easeInOutCubic');





 });

CSS:

.plane {
background-image:url('ab.png');
position:absolute;
width:48px;
height:48px;
top:400px;
left:0;
}

推荐答案

(由OP在对该问题的编辑中进行了回答.此处转录为社区Wiki答案-尽管有点简洁.请参见

(Answered by the OP in an edit to the question. Transcribed here as a community wiki answer - even though its a bit terse. See Question with no answers, but issue solved in the comments (or extended in chat) )

OP写道:

在经过200多次查看并且没有答案之后,我找到了解决方案,将其放置在这里给那些面临相同问题的人.您需要将元素的位置更改为相对".

Well after more than 200 views and no answer , I found the solution, I'll put it here for those who faced the same problem. You need to change position of your element to "relative".

这篇关于jQuery动画无法在Safari中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆