Advertisement
jaggedsoft

super simple html5 tooltips

Jun 7th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.04 KB | None | 0 0
  1. <style>
  2. /* this is css */
  3. #theid {
  4. -moz-transition-property:opacity;
  5. -moz-transition-duration:1.3s;
  6. -webkit-transition-property:opacity;
  7. -webkit-transition-duration:1.3s;
  8. opacity:1.0;
  9. font-weight:lighter;
  10. font-family:"calibri";
  11. font-size:18px;
  12. text-shadow:1px 1px 0px rgba(255,255,255,0.6);
  13. }
  14. </style>
  15.  
  16.  
  17. <!-- this is just html with javascript events -->
  18. <div id='theid'>
  19. this is the content div
  20. </div>
  21. <a href='/#' onmouseover='showtipno(0)' onmouseout='_tooltip.style.opacity=0.0;'>one</a> ..
  22. <a href='/#' onmouseover='showtipno(1)' onmouseout='_tooltip.style.opacity=0.0;'>two</a> ..
  23. <a href='/#' onmouseover='showtipno(2)' onmouseout='_tooltip.style.opacity=0.0;'>three</a> ..
  24.  
  25. <script>
  26. // this is javascript
  27. var _tooltip = document.getElementById('theid');
  28. var helptips = [
  29.     "tooltip #1",
  30.     "tooltip #2",
  31.     "something else for number three",
  32. ];
  33. function showtipno(_tipno) {
  34.     _tooltip.innerHTML = "<img src='http://67.91.221.89/img/help.png' class='helpico'> &nbsp;"+helptips[_tipno];
  35.     _tooltip.style.opacity = 1.0;
  36. }
  37. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement