HI,
I am trying to figure out how I can style the sub-menu to stay up when the parent li is clicked (not only hovered). I have found a solution with JS which uses below code:
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
var $j = jQuery.noConflict();
$j(document).ready(function() {
});
function Reveal(a){
var ul = a.parentNode.getElementsByTagName("UL").item(0);
$j(ul).animate({height: 'toggle' ,opacity: 'toggle'}, "slow");
}
</script>
But I also have to add this code to the sub-menu li: <li onclick="Reveal(this);"><a href="#">testimonials</a>
The question is I don’t know how to add onclick="Reveal(this); to the li.
Does anybody know how to add this functionality please?
Sure would be nice to have an answer to this question. I to am looking to add an onclick to the normal WordPress menu at the “li” level of the menu item.