Using the jQuery tipsy plugin on a list item


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



Copy this code and paste it in your HTML
  1. $(document).ready(function() {
  2.  
  3. $('li').tipsy({
  4. fade: false,
  5. gravity: 's',
  6. title: function() {
  7. if (this.getAttribute('original-title') !== '') {
  8. return this.getAttribute('original-title');
  9. } else {
  10. $(this).tispy();
  11. // Not perfect, need it to actually not call tipsy on an empty title, this works but not sure why or how.
  12. }
  13. }
  14. });
  15.  
  16. });
  17.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.