tags:

views:

59

answers:

2

How to make it sideup and side down

when i use this it sides down then up??

$("button").click(function () {
  $("p").slideToggle("slow");
});
A: 

Use something like this:

$("button").click(function () {
  $("p").slideUp("slow", function() {
     $("p").slideDown("slow");});
});

Alternatively, you could create a custom animation.

kgiannakakis
+1  A: 

Here's my version - jQuery methods always return the jQuery object, which allows you to string an animation together like this:

$("button").click(function () {
   $("p").slideUp("slow").slideDown("slow");
});
Sohnee