I noticed that after the ajax page load, it does not scroll to the top of the page. Is there a particular reason?
I added three lines to ajax_pages.js file, to go back to the top, if no anchor.
Are you okay with that?

Here is the patch..

CommentFileSizeAuthor
scroll_top_of_page_after_ajax_load.patch532 bytesOwilliwO
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamix’s picture

I think it's a great idea, thanks. How about making it an option (i.e. checkbox) on the module settings page?

q00q00’s picture

Great idea, but how to preserve a scroll position on history back?

T.Mardi’s picture

Thanks for the patch, it works great! Is there a way to make the scroll to top any smoother?

wsjnorway’s picture

Where do i put the patch?
I have been looking for a way to make the page reload scroll to top and this seems to work, but after i put in the file using notepad++ the module stops work and pages load normally and not using ajax.

Edit: Sorry for the grammatical errors. I think i know where to insert the code, however the problem remains.
Either clicking on a link takes you to the top of the next page without using the module, or the module works but you always end up "scrolled down to the bottom" on the page you are loading.

It seems like this fix disables the whole module.

T.Mardi’s picture

Did you insert the 3 lines of code into the ajax_pages.js file inside the module folder? You will need to remove the '+' before each line.

Here's a guide on how to apply patches manually

Remember to flush caches after you change a template or module file.