How Do I Add a Scrollbar to My Menu in WordPress?
Adding a scrollbar to a WordPress menu can be done in a few simple steps. To add a scrollbar to a WordPress menu, first install the ScrollTo plugin. Once the plugin is installed, open the Settings page and click the Add New Scrollbar button.
Enter a name for the scrollbar (in this example, we will call it Scrollbar 1), and select the type of scrollbar that you would like to use (in this example, we will use the vertical scrollbar). Click the Save button to save the new scrollbar. Next, open the WordPress menu in your editor of choice and add the following code to the
.
$(document).ready(function() {
$("#scrollbar1").scrollTo(0, 100);
});
Now that the scrollbar has been added, you will want to adjust the position of the scrollbar so that it is visible when the menu is displayed. To do this, open the Settings page for the ScrollTo plugin and click the Position button. Enter a value in the X position field (in this example, we will enter 0), and enter a value in the Y position field (in this example, we will enter 100).
Click the Save button to save the new position settings. Finally, you will want to add a link to the scrollbar in the
- element. To do this, add the following code to the
- Scroll to Top
- element:.
Now that the scrollbar has been added, you can test the menu to make sure that everything is working as expected. To do this, click the link in the
- element that links to the scrollbar, and wait until the scrollbar has reached the top of the page.