jquery animate()在chrome和firefox中不起作用

时间:2015-01-26 14:20:13

标签: jquery google-chrome jquery-animate

以下jQuery动画功能在chrome和Firefox中不起作用任何想法为什么?它完全适用于Safari。

   <!doctype html>
   <html lang="en" ng-app="myApp">
   <head>
   <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
   </head>

  <body>
  <header>

   <div class="logoDiv"><img class="logoIcon" src="KM&T-world.png"></div>
   <div><img class="iphone"  id="iphoneRight" class="slideLeft" src=""></img></div>
   <h1 class="logoTagLine"></h1>
   <p class="headerPara"></p>
   <h1 class="mainTag"></h1>
   <h2 class="secTag"></h2>

   </header>
   <div class="heart"><img class="heartIcon" src="Heart-ECG.png"></img></div>
   <div class="row"  class="test">

   <div class="col-xs-6 col-md-4"><img class="test" src="globe2.png"></div>
   <div class="intoPara"></div>
   <div class="col-xs-6 col-md-4"></div>
   </div>

   <script>

   $(function() {
        $('.iphone').animate({right:300}, 1200);
        $('.test').animate({bottom: 200}, 1200);
    });
   </script>

</body>
</html>

以上是完整的代码。

1 个答案:

答案 0 :(得分:1)

这很有效。

<html>
<body>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<div class="iphone" style="background-color: red; width: 200px; position: relative">asdfdasfasdfdasfdas</div>
<div class="test" style="background-color: blue; width: 200px; position: relative">zcv zvcxz vxcvxcz xcvz</div>

<script>

$(function() {
        $('.iphone').animate({right:'300px'}, 1200);
        $('.test').animate({bottom:'100px'}, 1200);
    });

</script>

</body>
</html>