/*! * 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); } if (options.autoopen) { setTimeout(function() { 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('