Prototype Based JavaScript Tooltip

/ Published in: JavaScript
Save to your folder(s)

JavaScript Tooltip libraries number about as many as rounded CSS corner libraries.

Jonathan Weiss thought the ones he saw were "too complicated and bloated, did just too much and most of the time were still not flexible enough with the tooltip. So I decided to create my own library that is based on prototype.js".

Copy this code and paste it in your HTML
  1. <script src="/javascripts/prototype.js" type="text/javascript"></script>
  2. <script src="/javascripts/tooltip.js" type="text/javascript"></script>
  3. <div id='tooltip' style="display:none; margin: 5px; background-color: red">
  4. Detail infos on product 1....<br />
  5. </div>
  7. <div id='product_1'>
  8. This is product 1
  9. </div>
  11. <script type="text/javascript">
  12. var my_tooltip = new Tooltip('product_1', 'tooltip')
  13. </script>


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.