wp_nav_menu onmouseover event changing link color?
-
Hi all,
I’m trying to see how I could get my nav to have an onmouseover event to change the color of the link. I found this code online that I’m trying to implement:
https://www.ezineasp.net/post/Javascript-Change-Link-Text-Color-onmouseover.aspx
Seems pretty simple and straightforward but when I try to edit the nav-menu-template.php file, specifically line 90…
$item_output .= ‘<a’. $attributes .’>’;
to which I want to add…
onmouseover=”this.style.color=’#008000′” onmouseout=”this.style.color=’#999999′”
… inside the a href tag to initialize the JS function to change the link color. Can someone tell me if I’m going about this the wrong way? Because when I add that extra code, it doesn’t show up in the source code even after I uploaded the newly edited nav-menu-template.php.
Any help would be greatly appreciated.
Thanks!
David
- The topic ‘wp_nav_menu onmouseover event changing link color?’ is closed to new replies.