I would like to use JQuery easing to navigate to a named section in my page, and so far it works.
In one of the sections, I have a form which I would like to have centered vertically and horizontally, so I placed it in a sub-div, and vertically/horizontally centered it.
What I'm not sure how to do is to change the javascript so that when jumping to the form section, the form eases to the middle of the page.
I am using the following code block:
$('.nav a').bind('click',function(event){
var $anchor = $(this);
$('html, body').stop().animate({
scrollTop: $($anchor.attr('href')).offset().top
}, 1500,'easeInOutExpo');
event.preventDefault();
});
Here's a JSFiddle of what I have, can any one please enlighten me? Thanks!
http://jsfiddle.net/soraya_soch/LyDWH/
[EDIT]
My goal is when clicking on the link, that the page eases down and ceters the form's div.