I have got a script here that animates a div changing height, then after a label should appear. Under that I have return false so the next page doesn’t load.
It works when it is like this
$("label#error-username_r").show();
return false;
However when I set the duration it ignores it, and ignores the return false and loads the next page like this:
$("label#error-username_r").show("fast");
return false;
Here is all of the code:
$("div#cover").animate
({
height: window.innerHeight*0.8
}, {queue:false, duration:300, easing:"backEaseInOut"}
);
$("div#cover-bottom").animate
({
height: window.innerHeight*0.2
}, {queue:false, duration:300, easing:"backEaseInOut"}
);
$("label#error-username_r").show();
return false;
It’s kinda hard to dig out the real problem without HTML. And I don’t think it’s because
show("fast")failed here. It’s gotta be some other code that behaved incorrectly.You might want to try the duration as the passing parameter, like this
But I doubt that would really solve your problem either, as I said earlier, the error most likely is in somewhere else of your code.
Anyway, I’d suggest you try Firebug or any other web development tools to inspect the js errors and see what the error messages are.