|
API
Scripting APIThe Simpletip comes with a great scripting API for users. A lot of effort has been made to make sure you have the necessary functionality to enrich the library with as little effort as possible. Once you've setup your simpletip on your element(s) the API can be accessed via the simpletip() call. An example of this is below: // Create your tooltips
$('JQUERY SELECTOR').simpletip();
// Access the API of a previously initatied simpletip
var api = $('JQUERY SELECTOR').eq(0).simpletip();
// Perform a simple API call to update tooltip contents
api.update('New tooltip content!');Here's a list of all API methods available to you in the library:
Callback functionsThe Simpletip library provides several key callback functions as part of it's API, allowing you to extend the functionality of the library with custom methods. Below is an example utilising the onShow method to change the content an element: $("JQUERY SELECTOR").simpletip({
// onShow method - change content of parent element
onShow: function(){
this.getParent().text('My content changes when my tooltip appears!')
}
// Configuration properties
content: 'My Simpletip'
});Checkout the demos page for more examples. | ||||||||||||||||||||||||||||||||||||||||
► Sign in to add a comment