var tooltips = {
'img.thumb' : function(element) {
element.onmouseover = function(event) {
var opt = {
method: 'post',
postBody: params,
onSuccess: function(t) {
var tooltipContent = '';
/* Some code that will generate XHTML to populate the tooltip
...
*/
domTT_activate(this, event,
'content', tooltipContent,
'type', 'velcro',
'styleClass', 'tooltip',
'closeAction', 'destroy'
);
},
on404: function(t) {
alert('Error 404: location "' + t.statusText + '" was not
found.');
},
onFailure: function(t) {
alert('Error ' + t.status + ' -- ' + t.statusText);
}
}
new Ajax.Request('some_url.html', opt);
}
}
}
Behaviour.register(tooltips);