Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions jquery.tipTip.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
fadeIn: 200,
fadeOut: 200,
attribute: "title",
content: false, // HTML or String to fill TipTIp with
content: false, // HTML String or function to fill TipTIp with
enter: function(){},
exit: function(){}
};
Expand All @@ -51,12 +51,7 @@

return this.each(function(){
var org_elem = $(this);
if(opts.content){
var org_title = opts.content;
} else {
var org_title = org_elem.attr(opts.attribute);
}
if(org_title != ""){
if(opts.content || org_elem.attr(opts.attribute)){
if(!opts.content){
org_elem.removeAttr(opts.attribute); //remove original Attribute
}
Expand Down Expand Up @@ -99,6 +94,8 @@

function active_tiptip(){
opts.enter.call(this);
var org_title = typeof opts.content === 'function' ? opts.content.call(org_elem, opts) : opts.content;
org_title = org_title || org_elem.attr(opts.attribute);
tiptip_content.html(org_title);
tiptip_holder.hide().removeAttr("class").css("margin","0");
tiptip_arrow.removeAttr("style");
Expand Down