移动一个位置绝对图像

Move a position absolute image

本文关键字:位置 图像 一个 移动      更新时间:2023-09-26
$("#plane").animate({
    "opacity"     : 0.8
    "margin-left" : 0
},10000).fadeOut('slow');
<div class="LogoBG">
    <span class="plane" id="plane">
          <img src="<?php echo ROOTPATH ?>img/plane.png" alt="" />
        </span>
</div>

.LogoBG .plane {
    float:right; margin-left:666px;position:absolute;
}

我想把对象从margin-left:666移动到0。此外,我想淡化图像时,是在的margin-left属性小于<333. 如果可以的话。

谢谢

这个呢:

$(document).ready(function() {
    $("#plane").animate({'margin-left': 333}, 1000, 'linear')
               .animate({'margin-left': 0, 'opacity':0}, 1000, 'linear');
});

试试这个:

$("#plane").animate(
  {"margin-left": 333},
  5000,
  'linear', 
  function(){
    $(this).animate(
      {"opacity": 0, "margin-left": 0},
      5000,
      'linear'
    );
  }
);

下面是测试它的方法:
http://jsfiddle.net/5BZR3/4/