Skip to content

Instantly share code, notes, and snippets.

@ssajous
Created December 17, 2013 20:23
Show Gist options
  • Select an option

  • Save ssajous/8011940 to your computer and use it in GitHub Desktop.

Select an option

Save ssajous/8011940 to your computer and use it in GitHub Desktop.
// tooltip binding
// usage: data-bind="tooltip: { title: 'My tooltip text', trigger: 'hover click', placement: 'right'}"
ko.bindingHandlers.tooltip = {
init: function (element, valueAccessor) {
var options = ko.utils.unwrapObservable(valueAccessor());
$(element).tooltip(options);
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment