I'm having trouble getting the animate function to only move the specified DIV. Instead, it moves the entire page. If you click "RSVP" on the link below you can see what I am talking about. I've tried switching it to call only certain ID's (ie .wrap vs #header) but it didn't do anything. How do you get it to only animate the header and not scroll anything else?
Here's my code. There's more to it, but I only included the JQuery that had fade/scroll properties:
$.ajax({
type: "POST",
url: "http://mktietheknot.com/wp-content/themes/Retro/rsvp-process.php",
data: dataString,
dataType: "json",
success: function(data) {
if ( data.status == 'pass' ) {
$('#rsvp-form').fadeOut(function(){
$('#rsvp-form').html('<div class="rsvp-received">' +data.response+ '</div>').fadeIn(1000);
});
myTimer = $.timer(2500,function(){
$('#rsvp .rsvp-link').click();
});
}
else {
$('#rsvp-form').append('<div class="error">' +data.response+ '</div>');
$('#rsvp .submit').fadeIn('500');
console.debug(data);
}
}
});
return false;
});
});
$('#nav-rsvp a').unbind();
$('#nav-rsvp a, .rsvp-link').click(function(){
if ( $('.wrap').hasClass('open') ) {
$('.wrap').animate({
top: '-=115'
}, 750, 'easeInOutCubic');
$('.wrap').removeClass('open');
}
else {
$('.wrap').animate({
top: '+=115'
}, 750, 'easeInOutCubic');
$('.wrap').addClass('open');
}
return false;
});
})(jQuery);
Here is he complimenting CSS:
/* === Header Section === */
#header {
background:url(wp-content/themes/Retro/images/structure/body_bg.png) repeat-x scroll center bottom transparent;
padding: 0 0 13px;
position:fixed;
width: 100%;
z-index: 100;
}
#header .section_inn {
padding-top: 0;
background:url(http://mktietheknot.com/wp-content/themes/Retro/images/structure/body_bg_brown.png) repeat-x;
width: 100%;
height: 130px;
z-index: 1000;
}
#header .wrap {
background: none repeat scroll 0 0 transparent;
width: auto;
top:-115px;
}
Thanks guys!