diff --git a/src/javascripts/jquery.tipsy.js b/src/javascripts/jquery.tipsy.js index f95c063..6e7be33 100644 --- a/src/javascripts/jquery.tipsy.js +++ b/src/javascripts/jquery.tipsy.js @@ -14,7 +14,16 @@ if (ele == document) return true; } return false; - }; + } + + function jQueryDelegateEventMethod() { + var majorVersionNumber = parseFloat($().jquery); + if (majorVersionNumber >= 1.7) { + return 'on'; + } else { + return 'live'; + } + } function Tipsy(element, options) { this.$element = $(element); @@ -174,7 +183,7 @@ if (!options.live) this.each(function() { get(this); }); if (options.trigger != 'manual') { - var binder = options.live ? 'live' : 'bind', + var binder = options.live ? jQueryDelegateEventMethod() : 'bind', eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; this[binder](eventIn, enter)[binder](eventOut, leave);