2011-12-02 37 views
0
$("#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.如果这是可能。移动一个位置的绝对图像

感谢

回答

0

试试这个:

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

下面是测试它小提琴:
http://jsfiddle.net/5BZR3/4/

1

这个怎么样:

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

肯定比我的雨衣。 ;) – Jpsy

+0

呃呃没有注意到它基本上是一样的!对不起... – StefanoP

+0

它真的工作吗?http://jsfiddle.net/5BZR3/6/ – aWebDeveloper