am-impact / amnav

Navigation plugin for Craft
168 stars 20 forks source link

update url & set `.active` with `#target` on one page scroller #53

Closed sethburtonhall closed 8 years ago

sethburtonhall commented 8 years ago

I have a one page scrolling site where the nav items are using #ID target links. As of now, clicking the nav items scrolls to the correct #ID but the url is not reflected and the .active class is not set.

example markup

<li class="first">
    <a href="#about" title="About">About</a>
</li>

When the above "About" nav item is clicked I would like it to produce this url http://example.com/#about as well as set the <li> to .active.

Is the currently an option?

sethburtonhall commented 8 years ago

any help with this?

hubertprein commented 8 years ago

@middle8media The only way of doing this properly, is by writing javascript for this. Your scenario isn't something that should be done by the plugin, it's quite the custom code.

sethburtonhall commented 8 years ago

Ok. Will do.