Question

I am using the Jquery based multi select dropdown provided by Eric Hynds.

I would like to add tooltip to the selection button and also each item in the dropdown list. The reason - I truncate the text in both the display and the selection list and tooltip is supposed to show the full text. But I cannot find any documentation on how to add this. Any help appreciated. Thanks.

Was it helpful?

Solution 2

Thanks Rahul. I didnt directly use li, but that did give me an idea. The control internally converts each li item to have a checkbox and a span with text. I gave a class to that particular span control. Before truncating the text, I updated the title property with the text.

$(".truncate").each(function(){
  $(this).attr('title', $(this).html());
});

Thanks for your pointer.

OTHER TIPS

your option will get converted to li tags when you use this plugin so give them attribute title this

$('li').attr('title','tooltip text');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top