Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

CSS Class active #150

Open
dzkanch opened this issue Feb 14, 2016 · 13 comments
Open

CSS Class active #150

dzkanch opened this issue Feb 14, 2016 · 13 comments

Comments

@dzkanch
Copy link

dzkanch commented Feb 14, 2016

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>
@davist11
Copy link
Owner

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

@dzkanch
Copy link
Author

dzkanch commented Feb 17, 2016

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

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

@davist11
Copy link
Owner

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

@dzkanch
Copy link
Author

dzkanch commented Feb 17, 2016

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

www.demowebsiteaddress.net/dev

@davist11
Copy link
Owner

What is not working?

@dzkanch
Copy link
Author

dzkanch commented Feb 17, 2016

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..

@davist11
Copy link
Owner

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

Isn't the parent active?

@dzkanch
Copy link
Author

dzkanch commented Feb 17, 2016

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..

@davist11
Copy link
Owner

You can use the scrollChange() callback

@dzkanch
Copy link
Author

dzkanch commented Feb 17, 2016

<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..

@davist11
Copy link
Owner

You can do all that with the callbacks

@dzkanch
Copy link
Author

dzkanch commented Feb 17, 2016

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

Thank you,

@davist11
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants