With CSS or with JS?
Here with CSS:
<html>
<head>
<style type="text/css">
li:hover > ul {
display:block;
}
.submenu {
display:none;
}
</style>
</head>
<body>
<ul class="menu">
<li>
<a href="">Header</a>
<ul class="submenu">
<li><img src=""/> Link 1</li>
<li><img src=""/> Link 2</li>
</ul>
</li>
</ul>
</body>
</html>
But this probably does not work in IE6 and lower (thanks Andy E) as the don't allow the :hover
pseudo selector with other selectors than a
.
There are better approaches but as your question is not very specific, this is my solution.
Edit:
This would be
li a:hover + ul {
display:block;
}
Reference.
Be aware that this might not work with every browser. But you'll find plenty information which CSS elements are supported by which browser in the internet.