2013-08-18 561 views
0

我不知道它是如何拼寫的,所以我無法執行精確搜索。我搜索過「滑入」,但這不是我真正想要的。我怎樣才能實現這與jQuery?

有一個畫面:enter image description here

正如你所看到的,球應來自該網站的頂部,從無形到網頁的某個地方。

任何提示?

+0

是該動畫是從上一張幻燈片。 – Daniel

+0

嘗試[animate()](http://api.jquery.com/animate/)。 –

回答

1

這是你所需要的:http://jsfiddle.net/LYA8L/

HTML:

<button>Animate</button> 
<div class="circle"> 
</div> 

CSS:

.circle{ 
    width:50px; 
    height:50px; 
    background-color:orange; 
    border-radius:25px; 
    -webkit-border-radius:25px; 
} 

JS:

$(function(){ 
    $('button').on('click', function(){ 
     $('.circle').animate({ 
      marginTop: '300px', 
      marginLeft: '100px' 
     }, 2500); 
    }); 
}); 
1

完成:

$(".logo").animate({ 
    marginTop: "380px", 
}, 2500); 
2

http://jsfiddle.net/jq6Ja/

<div id="container"> 
    <div id="block"></div> 
</div> 

$("#block").animate({ 
    top: "+=50" 
    }, 1000, function() { 
    console.log('all done'); 
});