We would like to know how to toggle display on hover.
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
src='http://code.jquery.com/jquery-1.4.2.js'></script>
<style type='text/css'>
.desc {<!--from w ww. j ava 2s.c om-->
display: none;
}
</style>
<script type='text/javascript'>
$(window).load(function(){
$(document).ready(function() {
$(".body").hover(function () {
$(".desc").toggle();
})
});
});
</script>
</head>
<body>
<span class="body"> hover this </span>
<span class="desc"> show </span>
</body>
</html>
The code above is rendered as follows: