diff --git a/jquery.tipTip.js b/jquery.tipTip.js index 7eacf35..b7b93ba 100644 --- a/jquery.tipTip.js +++ b/jquery.tipTip.js @@ -32,6 +32,7 @@ fadeOut: 200, attribute: "title", content: false, // HTML or String to fill TipTIp with + ignoreEdges: false, // Ignore browser window edges enter: function(){}, exit: function(){} }; @@ -127,8 +128,12 @@ t_class = "_right"; } - var right_compare = (w_compare + left) < parseInt($(window).scrollLeft()); - var left_compare = (tip_w + left) > parseInt($(window).width()); + if (opts.ignoreEdges == false) { + var right_compare = (w_compare + left) < parseInt($(window).scrollLeft()); + var left_compare = (tip_w + left) > parseInt($(window).width()); + 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; + } if((right_compare && w_compare < 0) || (t_class == "_right" && !left_compare) || (t_class == "_left" && left < (tip_w + opts.edgeOffset + 5))){ t_class = "_right"; @@ -144,9 +149,6 @@ 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; - if(top_compare || (t_class == "_bottom" && top_compare) || (t_class == "_top" && !bottom_compare)){ if(t_class == "_top" || t_class == "_bottom"){ t_class = "_top";