From 355adc62cb46b3523539a3e0e4ced5c34b20b29d Mon Sep 17 00:00:00 2001 From: Eric Stobbart Date: Tue, 24 Dec 2013 20:22:54 -0500 Subject: [PATCH] onLoad function added. --- modalPopLite.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modalPopLite.js b/modalPopLite.js index 48927b4..8dbbeea 100644 --- a/modalPopLite.js +++ b/modalPopLite.js @@ -33,7 +33,7 @@ (function ($) { var popID = 0; $.fn.modalPopLite = function (options) { - var options = $.extend({}, { openButton: "modalPopLite-open-btn", closeButton: "modalPopLite-close-btn", isModal: false, callBack: null }, options); + var options = $.extend({}, { openButton: "modalPopLite-open-btn", closeButton: "modalPopLite-close-btn", isModal: false, onOpen: null, callBack: null }, options); return this.each(function () { popID++; @@ -65,6 +65,9 @@ $('#modalPopLite-wrapper' + thisPopID).css({ 'left': left + "px", 'top': top }); $('#modalPopLite-wrapper' + thisPopID).fadeIn('slow'); isOpen = true; + if (options.onOpen != null) { + options.onOpen.call(this); + } }); $(closeObj).live("click", function (e) {