Closed pappfer closed 8 years ago
There is no closure, this
will refer your own scope. I understand what you want to achieve but I don't know what would be the use case for this. Can you explain why you want the tooltip have the same content as the element you have the tooltip on?
For example when the text won't fit the container. See screenshot.
Looks reasonable. I'll do it later this day or tomorrow. Also please note that I'm going to use innerHTML
instead of textContent
.
BTW: Udv :)
It's done. It took faster than i tought :) Now you may use the :this
operator in the title attribute.
$.protip({
selector: '.jstree-anchor',
defaults: {
title: ':this'
}
});
I think it makes sense to have the selector's text as the default one for the tooltip. Bootstrap does this, too.
Also, what does
$(this)
refer to? I tried to make the element's text the default title (see code below), but this solution didn't work.