使用 jQuery 表单插件时,淡出表单和淡入结果的最佳方法是什么?(http://jquery.malsup.com/form/#getting-started)
<script type="text/javascript">
// prepare the form when the DOM is ready
$(document).ready(function() {
var options = {
target: '#t5',
beforeSubmit: showRequest,
success: showResponse
};
// bind to the form's submit event
$('#t5_booking').submit(function() {
$(this).ajaxSubmit(options);
return false;
});
});
// pre-submit callback
function showRequest(formData, jqForm, options) {
var queryString = $.param(formData);
// alert('About to submit: \n\n' + queryString);
}
// post-submit callback
function showResponse(responseText, statusText, xhr, $form) {
}
</script>