irwan

JQuery : Show And Hide On Mouseover/Out

Oct 19th, 2011
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>show and hide on mouseover/out</title>
  4.  
  5. <style>
  6.  
  7. body {
  8. font-family: Arial, Helvetica, sans-serif;
  9. font-size: 12px;
  10. }
  11. h1 {
  12. font-size: 18px;
  13. }
  14.  
  15. #initiallyHiddenBlock {
  16. display: none;
  17. }
  18.  
  19. #mouseRegion {
  20. background-color: #000;
  21. height: 20px;
  22. width: 100px;
  23. color:#fff;
  24. }
  25.  
  26. </style>
  27.  
  28. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
  29.  
  30. <script type="text/javascript">
  31.  
  32. $(document).ready(function() {
  33. $('#mouseRegion').hover(
  34. function() { $('#initiallyHiddenBlock').show() },
  35. function() { $('#initiallyHiddenBlock').hide() }
  36. );
  37. });
  38.  
  39. </script>
  40. </head>
  41. <body>
  42.  
  43. <h1><b> and hide on mouseover/out</b></h1>
  44. <div id="mouseRegion">test and insert </div>
  45. <p id="initiallyHiddenBlock">Normally when we work with web applications we need</p>
  46.  
  47. </body>
  48. </html>
  49.  
  50.  
Advertisement
Add Comment
Please, Sign In to add comment