-
☆ A M B ☆
- 24,524 Posts
I used a similar slide-out contact form on my own site, and I added this to the javascript that controls the slider:
$(document).ready(function(){
$("#contactArea").css('height', '0px');
$("#cancel").click(
function() {
$("#contactArea").animate({height: "0px"}, {queue:false, duration: 1700, easing: 'easeOutBounce'})
}
);
$("a.contact").toggle(
function () {
$("#contactArea").animate({height: "280px"}, {queue:false, duration: 1700, easing: 'easeOutBounce'})
},
function () {
$("#contactArea").animate({height: "0px"}, {queue:false, duration: 1700, easing: 'easeOutBounce'})
}
);
if($("div.errors").text() != '') { $("#contactArea").animate({height: "330px"}, {queue:false, duration: 1700, easing: 'easeOutBounce'});
}
if($("div.errors").text() == '') { $("#contactArea").animate({height: "0px"}, {queue:false, duration: 1700, easing: 'easeOutBounce'});
}
});
-
☆ A M B ☆
- 24,524 Posts
It all depends on the particular jquery plugin you are using, as well as the actual output of the formit. My code is for using eForm and Evo. I haven't looked at formit yet, so I don't know how it displays errors. Probably you can specify a container for error messages.
The point of the code I posted was to demonstrate how I check if the element that would contain an error message is empty or not, and if it wasn't empty (there was an error message) the form container is displayed, if it is empty then the form container is hidden. Use the same code for displaying/hiding the form as you do for displaying it in the first place.
-
☆ A M B ☆
- 11 Posts
I use Revo and Formit. Ok, will try to make it working.
www.oranza.com