Okay
  Public Ticket #173915
Menu item cause scroll on one page
Closed

Comments

  • Jonathan started the conversation

    Hi I am Nectar,

    I would like to create a dropdown menu from the primary nav menu. However, when you select the item I want it to scroll down and stop at the appropriate section. Make sense?

    For example, when you have a contents page and click on item 2.4, it auto-scrolls down to section 2.4.

    Thank you for your help!!

  •  8,838
    Tahir replied

    Hey Jonathan!

    Just grab this plugin:

    http://wordpress.org/plugins/page-scroll-to-id

    To use the scroll to plugin you just need to add anchor links from your menu items. So for example, ”#about” could be entered into a link: http://i.imgur.com/XUvsNXj.png and then it would correlate with the section on your page where you have:

     <div id="about"> </div>
    	


    (which gets added through the text tab of course).

    Finally, in the plugin settings there’s an input that says “selectors”. Add this inside of it:

    a[href*='#']

    Cheers


    ThemeNectar Support Team 

  • Jonathan replied

    Thank you! Great tool.

    Just one more question - it only seems to work if you are currently on the page with the ID. 
    See fire.uroom.org/denver - if you select the submenu 'New Placement' under the ABOUT menu item, nothing happens. If you go to the ABOUT page and then select it - it works great.

  •  8,838
    Tahir replied

    Hey Jonathan!

    That i am afraid is a technical limitation. Not much we can do about it. 

    Cheers


    ThemeNectar Support Team 

  • Jonathan replied

    Figured it out - if anyone has same issue, here is solution.

    You just need to add the full address in your links href (instead of just the hash with the id).
    In menus, change the URL field value of your WP menu item from #id to something like http://somesite.com/somepage/#id.