diff --git a/README.md b/README.md index 9f9dbf2..8086598 100644 --- a/README.md +++ b/README.md @@ -236,8 +236,8 @@ $('a').webuiPopover('destroy'); autoHide:false, // automatic hide the popover by a specified timeout, the value must be false,or a number(1000 = 1s). offsetTop:0, // offset the top of the popover offsetLeft:0, // offset the left of the popover - onShow: function($element) {}, // callback after show - onHide: function($element) {}, // callback after hide + onShow: function($element, $triggerElement) {}, // callback after show + onHide: function($element, $triggerElement) {}, // callback after hide } ``` diff --git a/src/jquery.webui-popover.js b/src/jquery.webui-popover.js index ba29c0a..8768c4a 100644 --- a/src/jquery.webui-popover.js +++ b/src/jquery.webui-popover.js @@ -274,7 +274,7 @@ this.$element.trigger('hidden.' + pluginType, [this.$target]); if (this.options.onHide) { - this.options.onHide(this.$target); + this.options.onHide(this.$target, this.getTriggerElement()); } }, @@ -349,7 +349,7 @@ this.displayContent(); if (this.options.onShow) { - this.options.onShow($target); + this.options.onShow($target, this.getTriggerElement()); } this.bindBodyEvents();