0
It is possible only with CSS change the direction of the arrow from the menu when opening the submenu?
I believe the question would be how to detect the click on the menu.
I’m using the toggleClass()
of jquery to do this, but would like to use only CSS.
In my case after I open the menu and I click again on it, the submenu closes, but the arrow does not change because the Focus remains on it. There’s no way around that?
– Diego Vieira
@Diegovieira It is necessary to know then what is this arrow: it is a background, it is an image, it is a pseudo-element?
– Sam
@Diegovieira Or rather, how is this submenu opened and closed? It is a function?
– Sam
@Diegovieira CSS just can’t detect click, it can only change the style of the element in front of an event: Focus, Hover, checked etc.
– Sam
I use :before to place the arrow and the menu opens through a function. Your solution works, but only when I click off the menu, do I need when I click on it to work.
– Diego Vieira
@Diegovieira The bad thing about working with pseudo-Elements is that you are a little limited. Check out this Jsfiddle that, instead of using :before, using a <span> is much easier.
– Sam