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
13 changes: 11 additions & 2 deletions jquery.hovercard.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,17 @@
hcImg = '<img class="hc-pic" src="' + options.cardImgSrc + '" />';
}

//Determine if detailsHTML is a callable function
var detailsHTML = '';
if($.isFunction(options.detailsHTML)){
//if so, call the function with the current object as the "this" value and argument, and update detailsHTML
detailsHTML = options.detailsHTML.call(obj, obj);
}else{
detailsHTML = options.detailsHTML;
}

//generate details span with html provided by the user
var hcDetails = '<div class="hc-details" >' + hcImg + options.detailsHTML + '</div>';
var hcDetails = '<div class="hc-details" >' + hcImg + detailsHTML + '</div>';

//append this detail after the selected element
obj.after(hcDetails);
Expand Down Expand Up @@ -360,4 +369,4 @@
});

};
})(jQuery);
})(jQuery);