views:

334

answers:

4

After I do the .post thing, I want to hide the first div with a left slide, then show the second with a right slide. My right-slide was working fine and then I went and tried to put in the left slide and I broke it all.

if(hasError == false) {
    $.post("/process-email-signups",{email_address: email_addressVal},
     function(data){
      $("#email_signup_form").hide("slide", { direction: "left" }, 1000); 
       function() {
      $("#thank_you_message").show("slide", { direction: "right" }, 1000);
       });
      }
     );
    }
+2  A: 

I'm not sure what the extra function() is doing, maybe try removing that?

if(hasError == false) {
    $.post("/process-email-signups",{email_address: email_addressVal},
        function(data){
                $("#email_signup_form").hide("slide", { direction: "left" }, 1000); 
                $("#thank_you_message").show("slide", { direction: "right" }, 1000);
        }
    );
 }
Daniel Lew
+3  A: 

You've got an extraneous function block in there. Try this instead:

function(data){
                $("#email_signup_form").hide("slide", { direction: "left" }, 1000); 

                $("#thank_you_message").show("slide", { direction: "right" }, 1000);

                }
        );
Brian
A: 
if(hasError == false) {
    $.post("/process-email-signups", {email_address: email_addressVal},
        function(data){
                $("#email_signup_form").hide("slide", { direction: "left" }, 1000); 
                $("#thank_you_message").show("slide", { direction: "right" }, 1000);
        }
    );
}
Oli
A: 

Awww, I heart stackoverflow! Thanks everyone!

So here is a mystery: I get no error (yeah!) but I also don't get a hide-slide (boo!). The div in question just disappears, then the next one slides in to the space. Do I need to do something different with my hide("slide") for it to work?

(I have used slideUp and slideDown in this same way before with no problems, but apparently this is what I get for trying to branch out!)

Eileen
Daniel Lew