I know this can be easily to be achieved with css and jQuery. You can apply style on the jQuery event onmouseover and onmouseout. When the user hovers over the menu this event will trigger I will show you how to create effects.
Example:
<html>
<head>
<title> create menu hover effect using onmouseover andonmouseout in JQuery</title>
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
</head>
<body style="width: 600px;">
<style type="text/css">
.menu {
background-color: #CDDC39;
list-style: none;
margin: 100px;
padding: 0;
width: 10em;
}
.menu li {
margin: 0;
padding: 5px;
}
.menu a {
color: #333;
}
</style>
<ul class="menu">
<li onmouseover="this.style.backgroundColor='#F44336';" onmouseout="this.style.backgroundColor='transparent';" style="background-color: transparent;">
<a href="http://www.infinetsoft.com/">learn dot net skills</a>
</li>
<li onmouseover="this.style.backgroundColor='#F44336';" onmouseout="this.style.backgroundColor='transparent';" style="background-color: transparent;">
<a href="http://www.infinetsoft.com/htmltry">Work out html</a>
</li>
<li onmouseover="this.style.backgroundColor='#F44336';" onmouseout="this.style.backgroundColor='transparent';" style="background-color: transparent;">
<a href="http://www.infinetsoft.com/Category/JQuery/9/1">jQurey tutorials</a>
</li>
</ul>
</body>
</html>
Output:
Post your comments / questions
Recent Article
- How to Enable Virtualization in BIOS Security Settings in Intel Processors For Android Studio?
- Dependency 'androidx.activity:activity:1.8.0' requires libraries and applications that depend on it.
- AttributeError: 'NoneType' object has no attribute 'get_text' - Python
- ModuleNotFoundError: No module named 'openpyxl' - Python
- How to get thumbnail from vimeo video URL in Python?
- Remove all special characters, punctuation except spaces from string - Python
- OSError: cannot write mode RGBA as JPEG- Python
- expected str, bytes or os.PathLike object, not JpegImageFile - Python
Related Article