Forums
Home / Themes and Templates / onmouseover events in wp_nav_menu ?
(@rcwatson)
13 years, 6 months ago
Is it possible to insert onmouseover and onmouseout events via the wp_nav_menu menu insertion function?
For example, I’d like to take this wp_nav_menu generated code:
<li id="menu-item-77" class="menu-item menu-item-type-post_type menu-item-77"><a href="http://example.com/blog/?page_id=16">News</a></li>
and insert onmouseover/onmouseout like this:
<li id="menu-item-77" class="menu-item menu-item-type-post_type menu-item-77"><a href="http://example.com/blog/?page_id=16" onmouseover="mopen('m2')" onmouseout="mclosetime()">News</a></li>
Is that supported somehow in the args passed to wp_nav_menu? I’ve read the Codex, but can’t wrap my head around how to do this.
Thanks.