javascript - Generating tooltip text from .js/external file -
i have created simple jquery toolip: http://jsfiddle.net/oampz/k9thh/
my issue dont want place text within img
tag have on 20 tooltips on page lot of text in each.. there way can have tooltip access .js file (or other file) , capture necessary text that?
html:
<img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 1" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 2" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 3" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 4" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 5" height="20px" /> <br> <img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 6" height="20px" />
jquery:
$(function () { $(".tooltip").tooltip({ show: { effect: "slidedown", delay: 250 } }); });
thanks
$(document).tooltip({ show: { effect: "slidedown", delay: 250 }, content: function() { var element = $( ); if ( element.is( ".the_class" ) ) { return "the text here"; } }, });
Comments
Post a Comment