This is related to the tooltip plugin - http://docs.jquery.com/Plugins/Tooltip
.
I've written a short PHP helper that displays tooltips. Simple
$myHelper->tooltip('text'); displays a nice icon and stores the text
to be printed out right before </body> tag. Works as expected.
Now... the problem is that sometimes I'd like to give a tooltip a
custom class. It's handled via extraClass option and works for me if
I hard-code it in my js file. My solution: assign that right-before-</
body> div a custom class and read this attrib's content in .js file.
My current JS code:
$(document).ready(function(){
$(".tip").tooltip({
bodyHandler: function() {return $($(this).attr("href")).html();},
delay: 0,
showURL: false,
});
});
I tried doing this (keep in mind that I'm new to jquery and js in
general):
$(document).ready(function(){
$(".tip").tooltip({
bodyHandler: function() {return $($(this).attr("href")).html();},
extraClass: function() {return $($(this).attr("href")).attr
("class");},
delay: 0,
showURL: false,
showBody: " - ",
});
});
... but firebug complains:
(classNames || "").split is not a function
curCSS()()jquery.min.js (line 21)
trigger()()jquery.min.js (line 25)
nodeName()()jquery.min.js (line 20)
filter()()jquery.min.js (line 12)
trigger()()jquery.min.js (line 25)
save()hotels.js (line 29)
ready()()jquery.min.js (line 26)
trigger()()jquery.min.js (line 25)
[Break on this error] for(var value=object[0];i<length&&callba...jQuery
(elem).is(":visible"))getWH();else
(jquery.min.js (line 21))
How shold my my extraClass line look like?