Currently we have the following jQuery to hide one option and show another. How can we give it a smoother transition where it slides/fades the old one up and slides/fades the new one in?
function pdi_click() {
if ($('#weekendpass').is(":checked") == true) {
$('.pdioption2').hide('fast');
$('input[name=pdinotattending]').attr('checked', false);
$('.pdioption1').show('fast');
} else {
$('.pdioption1').hide('fast');
$('input[name=pdiattending]').attr('checked', false);
$('.pdioption2').show('fast');
}
Please see jsfiddle to recommend jQuery suggestions.
Try using
slideTogglewith a callback specified for the complete function.Example: http://jsfiddle.net/8YSRm/2/