Reputation: 127
Hi I'd have put together basic jquery to make a menu at the top of a page appear, can I make this slide in from the top rather than just appear suddenly. I've tried to use .animate but couldn't place it correctly
$(document).ready(function() {
$('#toggle').click(function(){
$('div.menu').css('display', 'block');
});
});
Upvotes: 0
Views: 32
Reputation: 13741
You can use slide functions from jQuery library. slideDown
to open, slideUp
to hide.
$(document).ready(function() {
$('#toggle').click(function(){
$('div.menu').slideDown('slow');
});
});
Upvotes: 1