The above code works, when a link with a '#' is pressed after the new page has been loaded beforehand e.g. in "Recent Comments" (in the sidebar) on http://4nf.org/.
It doesn't work though when clicking e.g. "Google Analytics handling documented" on the homepage of http://4nf.org/ (with the following URL: http://4nf.org/installation/#gasetup). (If I dump the URL into the browsers address bar, it works)
A scroll is performed, but to the very bottom of the page...
EDIT: Now using the following up-to-date Pronto code:
var $el = $('#' + url.split('#')[1]), scrollTop;
if ($el.length) {
scrollTop = $el.offset().top;
}
if (scrollTop !== false) {
$window.scrollTop(scrollTop);
}
The same result as above
So, I reckon that parts of the "ajaxification" interfere with calculating the offset...
But what could that be??
EDIT. Solved(presumably)
The second animate() was running in the background, while the scroll was being performed.
Solved by introducing the function _doRender2() as a callback in the animate() call...
The above code works, when a link with a '#' is pressed after the new page has been loaded beforehand e.g. in "Recent Comments" (in the sidebar) on http://4nf.org/.
It doesn't work though when clicking e.g. "Google Analytics handling documented" on the homepage of http://4nf.org/ (with the following URL: http://4nf.org/installation/#gasetup). (If I dump the URL into the browsers address bar, it works)
A scroll is performed, but to the very bottom of the page...
Any ideas why?
I have provided the id like this:
EDIT: Now using the following up-to-date Pronto code:
The same result as above
So, I reckon that parts of the "ajaxification" interfere with calculating the
offset
... But what could that be??EDIT. Solved(presumably)
The second
animate()
was running in the background, while the scroll was being performed. Solved by introducing the function_doRender2()
as a callback in theanimate()
call...Test file