Skip to content

Instantly share code, notes, and snippets.

@m8rge
Last active September 8, 2020 10:20
Show Gist options
  • Save m8rge/61929a6c356349bf080c to your computer and use it in GitHub Desktop.
Save m8rge/61929a6c356349bf080c to your computer and use it in GitHub Desktop.
twitter bootstrap tooltip over select2
/**
* Declate title attribute on target select element.
* Initialize tooltip:
*/
jQuery("div.select2-container").tooltip({
title: function() {
return $(this).next().attr("title");
},
});
@pyriel4you
Copy link

Using tooltip semantic on the select element:
$("span.select2.select2-container").tooltip({
title: function() {
var title = $(this).prev().attr("data-original-title");
return title;
}
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment