davist11/jQuery-One-Page-Nav

CSS Class active

dzkanch opened this issue · 13 comments

Hi

how to assign the css active class on child element. and how to be open

i need it like example:

<ul>
<li class="has-parent-item sub-active"><a href="#">Main</a>
  <ul>
   <li class="active"><a>Sub main page</a></li>
   </ul>
</li>
</ul>

but its just working . that need to be sort out

<ul>
<li class="has-parent-item"><a href="#">Main</a>
  <ul>
   <li class="active"><a>Sub main page</a></li>
   </ul>
</li>
</ul>

It should add the class to the parent of the anchor.

but how to do.?
do you've some example..

when click on submenu the parent should be assigne the class class="sub-active"

I'm not sure what you mean but you can use the begin() and end() functions to add custom code

check here..
click on sub menu item..(Web design)

www.demowebsiteaddress.net/dev

What is not working?

when you click child items of web design.. the parent should be assign a class..

also when you scroll its not assigning the class on parent. its only assigning on the current menu item..

i did use custom callback. but when you are on scrolling mode its not working..

screen shot 2016-02-17 at 9 41 29 am

Isn't the parent active?

yes. only when you open it manually..
click on Hola. and then scroll from top to bottom you'll see the child items not expanding..

i did use some call backs.. but the problem is.. i couldnt capture the scrolling event..

You can use the scrollChange() callback

<ul>
<li><a href="#">One Page</a>
<ul><li class="current"><a href="#">Sub page</a></li></ul>
</li>

if we click on sub page. the class('current') is assigning on that. would be great if it will assign like that


<ul>
<li><a href="#">One Page</a>
<ul class="sub-active"><li class="current"><a href="#">Sub page</a></li></ul>
</li>

thats what i want. when click sub child the script add another class on parent item.

your script is absolutely working fine.. great. easy to customization(if you dont mind).
Thanks for your help and quick response..

let me know about this..

You can do all that with the callbacks

would you like to help me in that case.. i dont know much about Java.. and i waste lots of hours..

Thank you,

Sorry I don't have time to help every person with their specific situation