Maslosoft Binder Logo Maslosoft Binder Documentation
Knockout JS tracker and binding handlers with coffee and sugar

Tooltip

This adds tooltips dymanically without reinitializing tooltip on update.

Try to change text in input, this will update tooltip too.

NOTE: This requires slightly different tooltip initialization, using selector option.


Should have tooltip

Relevant code used in examples:

<div>
	<input data-bind="textInput: binder.model.Tooltip.title"></input><br/>
	<b data-bind="tooltip: binder.model.Tooltip.title">Should have tooltip</b>
</div>

<script>
	window.onload = (function () {­
		binder.model.Tooltip = new Maslosoft.Koe.Tooltip({­title: 'This is tooltip text'­});
		ko.applyBindings({­model: binder.model­}, document.getElementById('ko-binder'));
		jQuery('body').tooltip({­
			selector: '[rel~="tooltip"]'
		­});
	­});
</script>