Reputation: 5506
I don't know how it's spelled so I can't perform an exact search. I've searched for "slide in" but it's not what I really want.
There's a picture:
As you can see, the ball should come from the top part of the website, from invisible to the somewhere of the webpage.
Any tips?
Upvotes: 0
Views: 54
Reputation: 2157
This is what you need : 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);
});
});
Upvotes: 1
Reputation: 579
<div id="container">
<div id="block"></div>
</div>
$( "#block" ).animate({
top: "+=50"
}, 1000, function() {
console.log('all done');
});
Upvotes: 2