Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dojo get next sibling based on current event target

I have this dropdown menu, and all i want to do is upon firing the onmouseenter event, to change the border-left of the targets next sibling to white. So far i can address the currentTarget's border-left with ease, but i cant find a way to do the same for the next sibling. Any ideas ?

like image 859
mfreitas Avatar asked Feb 24 '23 11:02

mfreitas


2 Answers

please try this

dojo.query(evt.currentTarget).next()[0]
like image 107
Rajkamal Subramanian Avatar answered Feb 26 '23 00:02

Rajkamal Subramanian


The DOM node attribute nextSibling can be used to get the next sibling. See https://developer.mozilla.org/En/DOM/Node.nextSibling.

If you want to apply some filtering when getting next sibling, e.g. get the next sibling with a certain CSS class name, try to use dojo.query. For example,

dojo.query(node).siblings(".myClass")

returns a node list of siblings of node with class name myClass.

like image 20
Alex Cheng Avatar answered Feb 26 '23 00:02

Alex Cheng