javascript – Display image when hovering over nav item

javascript – Display image when hovering over nav item

You could try something like this if you want to handle this without JavaScript.

HTML

<div class=navbar__menu__menu>
    <a class=navbar__menu__item>Home<div><img src=/img/menu/menu-image-2.jpg /></div></a>
</div>

CSS

a>div { 
    display: none; 
}
a:hover>div { 
    display: block; 
}

I think with out different class name is hard to achieve

by with adding different class name you can achieve with JavaScript or jquery by add class or toggle class functionality

jquery example:

 $(.classname).hover(function () {
     $(this).toggleClass(result_hover);
 });

javascript – Display image when hovering over nav item

Leave a Reply

Your email address will not be published.