diff --git a/index.html b/index.html index 0213979..9ea4eed 100644 --- a/index.html +++ b/index.html @@ -143,6 +143,13 @@

Options

Enables background cover.
Disabled for tooltips. + + backgroundclass + string (CSS selector) + + Adds a class to the background of the overlay to enable custom animations for it.
+ Disabled for tooltips. + color string (CSS color) diff --git a/jquery.popupoverlay.js b/jquery.popupoverlay.js index cdc51bf..b43fb6a 100644 --- a/jquery.popupoverlay.js +++ b/jquery.popupoverlay.js @@ -1,247 +1,258 @@ /*! - * jQuery Popup Overlay - * - * @version 1.6.0 - * @requires jQuery v1.7.1+ - * @link http://vast-eng.github.com/jquery-popup-overlay/ - */ -(function ($) { - - var $window = $(window); - var options = {}; - var zindexvalues = []; - var lastclicked = []; - var onevisible = false; - var oneormorevisible = false; - var scrollbarwidth; - var focushandler = null; - var blurhandler = null; - var escapehandler = null; - var bodymarginright = null; - var opensuffix = '_open'; - var closesuffix = '_close'; - var focusedelementbeforepopup = null; - - var methods = { - - _init: function (el) { - var $el = $(el); - var options = $el.data('popupoptions'); - lastclicked[el.id] = false; - zindexvalues[el.id] = 0; - - if (!$el.data('popup-initialized')) { - $el.attr('data-popup-initialized', 'true'); - methods._initonce(el); - } + * jQuery Popup Overlay + * + * @version 1.6.0 + * @requires jQuery v1.7.1+ + * @link http://vast-eng.github.com/jquery-popup-overlay/ + */ + (function ($) { + + var $window = $(window), + options = {}, + zindexvalues = [], + lastclicked = [], + onevisible = false, + oneormorevisible = false, + scrollbarwidth, + focushandler = null, + blurhandler = null, + escapehandler = null, + bodymarginright = null, + opensuffix = '_open', + closesuffix = '_close', + focusedelementbeforepopup = null, + visibleScrollLocks = 0; + + var methods = { + + _init: function (el) { + var $el = $(el); + var options = $el.data('popupoptions'); + lastclicked[el.id] = false; + zindexvalues[el.id] = 0; + + if (!$el.data('popup-initialized')) { + $el.attr('data-popup-initialized', 'true'); + methods._initonce(el); + } - if (options.autoopen) { - setTimeout(function() { + if (options.autoopen) { methods.show(el, 0); - }, 0); - } - }, - - _initonce: function (el) { - var $body = $('body'); - var $wrapper; - var options = $el.data('popupoptions'); - bodymarginright = parseInt($body.css('margin-right'), 10); - - if (options.type == 'tooltip') { - options.background = false; - options.scrolllock = false; - } - - if (options.scrolllock) { - // Calculate the browser's scrollbar width dynamically - var parent; - var child; - if (typeof scrollbarwidth === 'undefined') { - parent = $('
').appendTo('body'); - child = parent.children(); - scrollbarwidth = child.innerWidth() - child.height(99).innerWidth(); - parent.remove(); } - } - - if (!$el.attr('id')) { - $el.attr('id', 'j-popup-' + parseInt(Math.random() * 100000000)); - } - - $el.addClass('popup_content'); - - $body.prepend(el); + }, - $el.wrap('