Reputation: 55
I have this function:
$('.Show').click(function() {
$('#mobile-nb-c').show(500);
$('.Show').hide(500);
$('.Hide').show(500);
});
This function opens my div like this:
But I would like it to make it open like this:
Can this be done?
Upvotes: 0
Views: 283
Reputation: 12152
show()
and hide()
both do not have any animation properties related to them. They will just hide an element or show it. You can use .animate()
for using all sorts of animations
Upvotes: 2
Reputation: 1089
Try this:
$('.Show').animate({ width: <yourWidth> }, 600)
$('.Hide').animate({ width: 0 }, 600)
Upvotes: 0