Skip to content

Commit

Permalink
Suggest an asynchronous task
Browse files Browse the repository at this point in the history
  • Loading branch information
louisameline authored Mar 6, 2017
1 parent 18bf108 commit 568f916
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ Or:
$.tooltipster.startSelectable(
$('#myelement').next(),
function(instance, selectedText) {
return $('<span><img src="image.jpg" /> Hello world</span>');

// some kind of asynchronous task
setTimeout(function() {
instance.content('My tooltip content');
}, 2000);

return $('<span><img src="spinner.gif" /> Loading...</span>');
}
);
```
Expand Down

0 comments on commit 568f916

Please sign in to comment.