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: 9 additions & 4 deletions jquery.tipTip.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
fadeIn: 200,
fadeOut: 200,
attribute: "title",
skipVerticalComparison: false,
content: false, // HTML or String to fill TipTIp with
enter: function(){},
exit: function(){}
Expand Down Expand Up @@ -144,9 +145,13 @@
marg_top = Math.round(top + h_compare);
}

var top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop());
var bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0;

var top_compare = false;
var bottom_compare = false;
if(!opts.skipVerticalComparison) {
top_compare = (top + org_height + opts.edgeOffset + tip_h + 8) > parseInt($(window).height() + $(window).scrollTop());
bottom_compare = ((top + org_height) - (opts.edgeOffset + tip_h + 8)) < 0;
}

if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){
if(t_class == "_top" || t_class == "_bottom"){
t_class = "_top";
Expand Down Expand Up @@ -188,4 +193,4 @@
}
});
}
})(jQuery);
})(jQuery);