Home › Forums › JavaScript › Smooth scroll div alignment on single page site. › Re: Smooth scroll div alignment on single page site.
October 29, 2012 at 5:16 am
#112861
Participant
I think the problem might be that you’re getting the top() for funding-areas, about-us and our-projects on document ready and maybe those elements are not yet completely loaded and resized. I’d try to move the three variable declarations insite the click function
$(‘#anchor-aboutus’).click(function(event) {
var slowScrollFunding = $(‘#funding-areas’).offset().top;
var slowScrollAbout = $(‘#about-us’).offset().top;
var slowScrollProjects = $(‘#our-projects’).offset().top;
…