How-To: Wordpress Particular page Auto Scroll feature to particular id after the page

First of all - Hi ! :slight_smile:

I would like to know how to make an auto scroll based on javascript within the Wordpress but working only on one particular page. In huge shortcut - user clicks on a page and then simply page scrolls to particular id after it loads itself.

I’ve created a folder ‘Scripts’ in wp-content to not make things in mess. Something tells me that there needs to be a file that is a script which I’ll place in ‘Scripts’ folder. After that probably I’ll have to ignit that script on that particular page in html view or raw-find the file of that page and edit it to inject the proper reference (for script ignition).

Probably also I need to mark a part of the page with an element that has an id. It can be a ‘div’ for example with and id=“scroll”. Then under script’s raw code I’ll have to refer to that particular place on page. Like that each view of the page will result in ignition of the script which again will give a result of auto-scroll to that particular div.

I am not new to html and css but to javascript - yes. Feels like rocket science gosh…

Any help in creating and implementing such a (theoretically simple) feature would be appreciated.

Hi there,

Welcome to the forums :slight_smile:

I use a plugin for this functionality: http://wordpress.org/extend/plugins/easy-smooth-scroll-links/
Install it and it does everything you need.

However, if you want to program something like this yourself, it’s quite simple.
Here’s a demo: http://jsfiddle.net/2LuNP/

Credit goes to @chris_upjohn ;

Hi! Thanks for the response :). I saw a couple of plugins that are doing such a things but I would prefer to write something by myself and learn thanks to that :). I’ll check the link !