Hi
I need to get url Instead of contact.htm and keep the animation. this is a modal window.
$(document).ready(function () {
$('#contactForm input.contact, #contactForm a.contact').click(function (e) {
e.preventDefault();
// load the contact form using ajax
$.get("contact.htm", function(data){
// create a modal dialog with the data
$(data).modal({
close: false,
position: ["0%",],
overlayId: 'contact-overlay',
containerId: 'contact-container',
onOpen: contact.open,
onShow: contact.show,
onClose: contact.close
});
});
});
// preload images
// var img = ['cancel.png', 'form_bottom.gif', 'form_top.gif', 'loading.gif', 'send.png'];
// $(img).each(function () {
// var i = new Image();
// i.src = 'Sliding_Modal_js_css' + this;
// });
});
var contact = {
message: null,
open: function (dialog) {
// add padding to the buttons in firefox/mozilla
if ($.browser.mozilla) {
$('#contact-container .contact-button').css({
'padding-bottom': '2px'
});
}
// input field font size
if ($.browser.safari) {
$('#contact-container .contact-input').css({
'font-size': '.9em'
});
}
// dynamically determine height
var h = 534;
if ($('#contact-subject').length) {
h += 2;
}
if ($('#contact-cc').length) {
h += 2;
}
var title = $('#contact-container .contact-title').fadeIn();
// $('#contact-container .contact-title').html('Loading...');
dialog.overlay.fadeIn(0, function () {
// dialog.container.fadeIn(100, function () {
// dialog.data.fadeIn(100, function() {
dialog.container.fadeIn(0, function () {
dialog.data.fadeIn(0, function () {
$('#contact-container .contact-content').animate({
height: h
}, function () {
$('#contact-container .contact-title').fadeIn();
$('#contact-container form').fadeIn();
});
});
});
});
},
close: function (dialog) {
$('#contact-container .contact-message').fadeOut();
$('#contact-container .contact-title').fadeOut();
$('#contact-container form').fadeOut();
$('#contact-container .contact-content').animate({
height: 100
}, function () {
dialog.data.fadeOut(0, function () {
dialog.container.fadeOut(function () {
dialog.overlay.fadeOut(function () {
$.modal.close();
});
});
});
});
},
error: function (xhr) {
alert(xhr.statusText);
},
showError: function() {
$('#contact-container .contact-message')
.html($('<div class="contact-error">').append(contact.message))
.fadeIn(0);
}
};