CSS hover to show and hide - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:css

Description

CSS hover to show and hide

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-1.11.0.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){/*w w w. j  a  v  a 2s  .c o  m*/
$('#p2').hover(
    function(){$('#para1').css('visibility','visible')},
    function(){$('#para1').css('visibility','hidden')});
});

      </script> 
 </head> 
 <body> 
  <p id="para1">Hello World!</p> 
  <p id="p2">This paragraph is not affected by the style.</p>  
 </body>
</html>

Related Tutorials