├── bower.json ├── bpopup.jquery.json ├── README.md ├── jquery.bpopup.min.js └── jquery.bpopup.js /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bPopup", 3 | "main": "jquery.bpopup.js", 4 | "version": "0.11.0", 5 | "description": " bPopup is a lightweight jQuery modal popup plugin. It doesn't create or style your popup but provides you with all the logic like centering, modal overlay, events and more. It gives you a lot of opportunities to customize so it will fit your needs.", 6 | "homepage": "https://github.com/dinbror/bpopup", 7 | "keywords": [ 8 | "bpopup", 9 | "popup", 10 | "overlay", 11 | "modal", 12 | "ui", 13 | "jquery", 14 | "jquery-plugin" 15 | ], 16 | "authors": [ 17 | { 18 | "name": "Bjørn Klinggaard", 19 | "url": "http://dinbror.dk", 20 | "email": "hello@dinbror.dk" 21 | } 22 | ], 23 | "license": "DWIWYWBPVMS", 24 | "moduleType": [ 25 | "jquery" 26 | ], 27 | "ignore": [] 28 | } 29 | -------------------------------------------------------------------------------- /bpopup.jquery.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bpopup", 3 | "title": "bPopup", 4 | "description": "bPopup is a lightweight jQuery modal popup plugin (only 1.49KB gzipped). It doesn't create or style your popup but provides you with all the logic like centering, modal overlay, events and more. It gives you a lot of opportunities to customize so it will fit your needs.", 5 | "keywords": [ 6 | "popup", 7 | "popin", 8 | "modal", 9 | "window", 10 | "options", 11 | "ui", 12 | "fade", 13 | "transition", 14 | "animation", 15 | "animate", 16 | "jquery" 17 | ], 18 | "version": "0.11.0", 19 | "author": { 20 | "name": "Bjørn Klinggaard", 21 | "url": "http://dinbror.dk/" 22 | }, 23 | "licenses": [ 24 | { 25 | "type": "DWIWYWBPVMS", 26 | "url": "http://dinbror.dk/blog/bPopup/#license" 27 | } 28 | ], 29 | "homepage": "http://dinbror.dk/blog/bpopup", 30 | "demo": "http://dinbror.dk/bpopup", 31 | "dependencies": { 32 | "jquery": ">=1.4.3" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## bPopup - If you can't get it up - use bPopup 2 | 3 | ### DEMO: ### 4 | http://dinbror.dk/bpopup 5 | 6 | ### API: ### 7 | http://dinbror.dk/blog/bpopup 8 | 9 | ### DESCRIPTION: ### 10 | bPopup is a lightweight jQuery modal popup plugin (only 1.34KB gzipped). It doesn't create or style your popup but provides you with all the logic like centering, modal overlay, events and more. It gives you a lot of opportunities to customize so it will fit your needs. 11 | 12 | ## CHANGELOG 13 | ### v 0.11.0 (01-24-2015) ### 14 | * Fixed [#7](https://github.com/dinbror/bpopup/issues/7) and [#21](https://github.com/dinbror/bpopup/issues/21). Using fallback width as default to fix the width issue when scrollbar visible. 15 | * Fixed [#8](https://github.com/dinbror/bpopup/issues/8) and [#17](https://github.com/dinbror/bpopup/issues/17). "insideWindow" function updated so it now checks if height OR width is inside window instead of only width AND height. 16 | 17 | ### v 0.10.0 (07-22-2014) ### 18 | * Bugfix: `autoClose` will not trigger if you close the popup before it times out. 19 | * Added: `reposition(animateSpeed)`, a public function that recalculates the center position of the popup. You can pass an optional animate speed attribute. If not defined it will use the `followSpeed` value ([#8](https://github.com/dinbror/bpopup/pull/8)). 20 | Usage: 21 | ```javascript 22 | var bPopup = $(‘element_to_pop_up’).bPopup(); 23 | bPopup.reposition(100); 24 | ``` 25 | * Added: Error handling when loading content with ajax. The first argument in the `loadCallback` is the status of the ajax request, success or error ([#32](https://github.com/dinbror/bpopup/pull/32)). 26 | * Added: bower.json ([#25](https://github.com/dinbror/bpopup/issues/25)). 27 | 28 | ### v 0.9.4 (08-19-2013) ### 29 | * Added: New transitions, `slideUp` and `slideBack`. 30 | * Added: `transitionClose`, gives you the possibility to use a different transition on close. 31 | * Added: `autoClose`, thanks to [Leonidaz](https://github.com/Leonidaz) for the suggestion. 32 | * Added: `iframeAttr`, so you now can control what attributes the iframe should have (and enable the scrollbar as many of you wants). 33 | * Removed: The minimum 20px gap at the top. It's 0 now. 34 | 35 | ### v 0.9.3 (03-24-2013) ### 36 | * Transition fix: Unbinding events earlier on close to prevent scroll/resize events triggered when closing the popup and using the "slideIn" or "slideDown" transition. 37 | * Transition fix: The public close function didn't close the popup when using the "slideIn" or "slideDown" transition. 38 | * Transition fix: Exit transition for "slideIn" and "slideDown" will now always slide graceful no matter how much you have scrolled. 39 | * Transition fix: Fixed odd behavior when using "slideIn" or "slideDown" with ajax calls. 40 | 41 | ### v 0.9.2 (03-23-2013) ### 42 | * Percentage fix: Resize center fix when using percentage for width/height. 43 | * Percentage fix: Recenter fix when using percentage for width/height in ajax(loadUrl) calls. 44 | * Improvement: Adding 'debounce' to resize event. 45 | 46 | ### v 0.9.1 (03-10-2013) ### 47 | * Legacy fallback: In version 0.9.0 I changed the default close class from bClose to b-close. To avoid issues when you update to latest version I'm also binding a close event on the old default close class, bModal. 48 | * Bugfix: When moving an iframe through the DOM, IE9 will excecute the code in the iframe as many times as moves you make. Each time (but the last one) will return udefined on Object, String, Array etc. 49 | * Bugfix: When appending is false no overlay was created. 50 | -------------------------------------------------------------------------------- /jquery.bpopup.min.js: -------------------------------------------------------------------------------- 1 | /*================================================================================ 2 | * @name: bPopup - if you can't get it up, use bPopup 3 | * @author: (c)Bjoern Klinggaard (twitter@bklinggaard) 4 | * @demo: http://dinbror.dk/bpopup 5 | * @version: 0.11.0.min 6 | ================================================================================*/ 7 | (function(c){c.fn.bPopup=function(A,E){function L(){a.contentContainer=c(a.contentContainer||b);switch(a.content){case "iframe":var d=c('");d.appendTo(a.contentContainer);t=b.outerHeight(!0);u=b.outerWidth(!0);B();d.attr("src",a.loadUrl);l(a.loadCallback);break;case "image":B();c("").load(function(){l(a.loadCallback);F(c(this))}).attr("src",a.loadUrl).hide().appendTo(a.contentContainer);break;default:B(),c('
').load(a.loadUrl,a.loadData,function(d,b,e){l(a.loadCallback,b);F(c(this))}).hide().appendTo(a.contentContainer)}}function B(){a.modal&&c('
').css({backgroundColor:a.modalColor,position:"fixed",top:0,right:0,bottom:0,left:0,opacity:0,zIndex:a.zIndex+v}).appendTo(a.appendTo).fadeTo(a.speed,a.opacity);C();b.data("bPopup",a).data("id",e).css({left:"slideIn"==a.transition||"slideBack"==a.transition?"slideBack"==a.transition?f.scrollLeft()+w:-1*(x+u):m(!(!a.follow[0]&&n||g)),position:a.positionStyle||"absolute",top:"slideDown"==a.transition||"slideUp"==a.transition?"slideUp"==a.transition?f.scrollTop()+y:z+-1*t:p(!(!a.follow[1]&&q||g)),"z-index":a.zIndex+v+1}).each(function(){a.appending&&c(this).appendTo(a.appendTo)});G(!0)}function r(){a.modal&&c(".b-modal."+b.data("id")).fadeTo(a.speed,0,function(){c(this).remove()});a.scrollBar||c("html").css("overflow","auto");c(".b-modal."+e).unbind("click");f.unbind("keydown."+e);k.unbind("."+e).data("bPopup",0=b.height()&&(f.height=b.height());c>=b.width()&&(f.width=b.width());t=b.outerHeight(!0);u=b.outerWidth(!0);C();a.contentContainer.css({height:"auto",width:"auto"});f.left=m(!(!a.follow[0]&&n||g));f.top=p(!(!a.follow[1]&&q||g));b.animate(f,250,function(){d.show();h=D()})}function M(){k.data("bPopup",v);b.delegate(".bClose, ."+a.closeClass,"click."+e,r);a.modalClose&&c(".b-modal."+e).css("cursor","pointer").bind("click",r);N||!a.follow[0]&&!a.follow[1]||k.bind("scroll."+e,function(){if(h.x||h.y){var d={};h.x&&(d.left=a.follow[0]?m(!g):"auto");h.y&&(d.top=a.follow[1]?p(!g):"auto");b.dequeue().animate(d,a.followSpeed,a.followEasing)}}).bind("resize."+e,function(){I()});a.escClose&&f.bind("keydown."+e,function(a){27==a.which&&r()})}function G(d){function c(e){b.css({display:"block",opacity:1}).animate(e,a.speed,a.easing,function(){K(d)})}switch(d?a.transition:a.transitionClose||a.transition){case "slideIn":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()-(u||b.outerWidth(!0))-200});break;case "slideBack":c({left:d?m(!(!a.follow[0]&&n||g)):f.scrollLeft()+w+200});break;case "slideDown":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()-(t||b.outerHeight(!0))-200});break;case "slideUp":c({top:d?p(!(!a.follow[1]&&q||g)):f.scrollTop()+y+200});break;default:b.stop().fadeTo(a.speed,d?1:0,function(){K(d)})}}function K(d){d?(M(),l(E),a.autoClose&&(H=setTimeout(r,a.autoClose))):(b.hide(),l(a.onClose),a.loadUrl&&(a.contentContainer.empty(),b.css({height:"auto",width:"auto"})))}function m(a){return a?x+f.scrollLeft():x}function p(a){return a?z+f.scrollTop():z}function l(a,e){c.isFunction(a)&&a.call(b,e)}function C(){z=q?a.position[1]:Math.max(0,(y-b.outerHeight(!0))/2-a.amsl);x=n?a.position[0]:(w-b.outerWidth(!0))/2;h=D()}function D(){return{x:w>b.outerWidth(!0),y:y>b.outerHeight(!0)}}c.isFunction(A)&&(E=A,A=null);var a=c.extend({},c.fn.bPopup.defaults,A);a.scrollBar||c("html").css("overflow","hidden");var b=this,f=c(document),k=c(window),y=k.height(),w=k.width(),N=/OS 6(_\d)+/i.test(navigator.userAgent),v=0,e,h,q,n,g,z,x,t,u,J,H;b.close=function(){r()};b.reposition=function(a){I(a)};return b.each(function(){c(this).data("bPopup")||(l(a.onOpen),v=(k.data("bPopup")||0)+1,e="__b-popup"+v+"__",q="auto"!==a.position[1],n="auto"!==a.position[0],g="fixed"===a.positionStyle,t=b.outerHeight(!0),u=b.outerWidth(!0),a.loadUrl?L():B())})};c.fn.bPopup.defaults={amsl:50,appending:!0,appendTo:"body",autoClose:!1,closeClass:"b-close",content:"ajax",contentContainer:!1,easing:"swing",escClose:!0,follow:[!0,!0],followEasing:"swing",followSpeed:500,iframeAttr:'scrolling="no" frameborder="0"',loadCallback:!1,loadData:!1,loadUrl:!1,modal:!0,modalClose:!0,modalColor:"#000",onClose:!1,onOpen:!1,opacity:.7,position:["auto","auto"],positionStyle:"absolute",scrollBar:!0,speed:250,transition:"fadeIn",transitionClose:!1,zIndex:9997}})(jQuery); 8 | -------------------------------------------------------------------------------- /jquery.bpopup.js: -------------------------------------------------------------------------------- 1 | /*=================================================================================================================== 2 | * @name: bPopup 3 | * @type: jQuery 4 | * @author: (c) Bjoern Klinggaard - @bklinggaard 5 | * @demo: http://dinbror.dk/bpopup 6 | * @version: 0.11.0 7 | * @requires jQuery 1.4.3 8 | *==================================================================================================================*/ 9 | ;(function($) { 10 | 'use strict'; 11 | 12 | $.fn.bPopup = function(options, callback) { 13 | 14 | if ($.isFunction(options)) { 15 | callback = options; 16 | options = null; 17 | } 18 | 19 | // OPTIONS 20 | var o = $.extend({}, $.fn.bPopup.defaults, options); 21 | 22 | // HIDE SCROLLBAR? 23 | if (!o.scrollBar) 24 | $('html').css('overflow', 'hidden'); 25 | 26 | // VARIABLES 27 | var $popup = this 28 | , d = $(document) 29 | , w = window 30 | , $w = $(w) 31 | , wH = windowHeight() 32 | , wW = windowWidth() 33 | , prefix = '__b-popup' 34 | , isIOS6X = (/OS 6(_\d)+/i).test(navigator.userAgent) // Used for a temporary fix for ios6 timer bug when using zoom/scroll 35 | , buffer = 200 36 | , popups = 0 37 | , id 38 | , inside 39 | , fixedVPos 40 | , fixedHPos 41 | , fixedPosStyle 42 | , vPos 43 | , hPos 44 | , height 45 | , width 46 | , debounce 47 | , autoCloseTO 48 | ; 49 | 50 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 51 | // PUBLIC FUNCTION - call it: $(element).bPopup().close(); 52 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 53 | $popup.close = function() { 54 | close(); 55 | }; 56 | 57 | $popup.reposition = function(animateSpeed) { 58 | reposition(animateSpeed); 59 | }; 60 | 61 | return $popup.each(function() { 62 | if ($(this).data('bPopup')) return; //POPUP already exists? 63 | init(); 64 | }); 65 | 66 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 67 | // HELPER FUNCTIONS - PRIVATE 68 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 69 | function init() { 70 | triggerCall(o.onOpen); 71 | popups = ($w.data('bPopup') || 0) + 1, id = prefix + popups + '__',fixedVPos = o.position[1] !== 'auto', fixedHPos = o.position[0] !== 'auto', fixedPosStyle = o.positionStyle === 'fixed', height = $popup.outerHeight(true), width = $popup.outerWidth(true); 72 | o.loadUrl ? createContent() : open(); 73 | }; 74 | 75 | function createContent() { 76 | o.contentContainer = $(o.contentContainer || $popup); 77 | switch (o.content) { 78 | case ('iframe'): 79 | var iframe = $(''); 80 | iframe.appendTo(o.contentContainer); 81 | height = $popup.outerHeight(true); 82 | width = $popup.outerWidth(true); 83 | open(); 84 | iframe.attr('src', o.loadUrl); // setting iframe src after open due IE9 bug 85 | triggerCall(o.loadCallback); 86 | break; 87 | case ('image'): 88 | open(); 89 | $('') 90 | .load(function() { 91 | triggerCall(o.loadCallback); 92 | recenter($(this)); 93 | }).attr('src', o.loadUrl).hide().appendTo(o.contentContainer); 94 | break; 95 | default: 96 | open(); 97 | $('
') 98 | .load(o.loadUrl, o.loadData, function(response, status, xhr) { 99 | triggerCall(o.loadCallback, status); 100 | recenter($(this)); 101 | }).hide().appendTo(o.contentContainer); 102 | break; 103 | } 104 | }; 105 | 106 | function open(){ 107 | // MODAL OVERLAY 108 | if (o.modal) { 109 | $('
') 110 | .css({backgroundColor: o.modalColor, position: 'fixed', top: 0, right:0, bottom:0, left: 0, opacity: 0, zIndex: o.zIndex + popups}) 111 | .appendTo(o.appendTo) 112 | .fadeTo(o.speed, o.opacity); 113 | } 114 | 115 | // POPUP 116 | calcPosition(); 117 | $popup 118 | .data('bPopup', o).data('id',id) 119 | .css({ 120 | 'left': o.transition == 'slideIn' || o.transition == 'slideBack' ? (o.transition == 'slideBack' ? d.scrollLeft() + wW : (hPos + width) *-1) : getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle)) 121 | , 'position': o.positionStyle || 'absolute' 122 | , 'top': o.transition == 'slideDown' || o.transition == 'slideUp' ? (o.transition == 'slideUp' ? d.scrollTop() + wH : vPos + height * -1) : getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle)) 123 | , 'z-index': o.zIndex + popups + 1 124 | }).each(function() { 125 | if(o.appending) { 126 | $(this).appendTo(o.appendTo); 127 | } 128 | }); 129 | doTransition(true); 130 | }; 131 | 132 | function close() { 133 | if (o.modal) { 134 | $('.b-modal.'+$popup.data('id')) 135 | .fadeTo(o.speed, 0, function() { 136 | $(this).remove(); 137 | }); 138 | } 139 | // Clean up 140 | unbindEvents(); 141 | clearTimeout(autoCloseTO); 142 | // Close trasition 143 | doTransition(); 144 | 145 | return false; // Prevent default 146 | }; 147 | 148 | function reposition(animateSpeed){ 149 | wH = windowHeight(); 150 | wW = windowWidth(); 151 | inside = insideWindow(); 152 | if(inside.x || inside.y){ 153 | clearTimeout(debounce); 154 | debounce = setTimeout(function(){ 155 | calcPosition(); 156 | animateSpeed = animateSpeed || o.followSpeed; 157 | var css = {}; 158 | if(inside.x) 159 | css.left = o.follow[0] ? getLeftPos(true) : 'auto'; 160 | if(inside.y) 161 | css.top = o.follow[1] ? getTopPos(true) : 'auto'; 162 | $popup 163 | .dequeue() 164 | .each(function() { 165 | if(fixedPosStyle) { 166 | $(this).css({ 'left': hPos, 'top': vPos }); 167 | } 168 | else { 169 | $(this).animate(css, animateSpeed, o.followEasing); 170 | } 171 | }); 172 | }, 50); 173 | } 174 | }; 175 | 176 | //Eksperimental 177 | function recenter(content){ 178 | var _width = content.width(), _height = content.height(), css = {}; 179 | o.contentContainer.css({height:_height,width:_width}); 180 | 181 | if (_height >= $popup.height()){ 182 | css.height = $popup.height(); 183 | } 184 | if(_width >= $popup.width()){ 185 | css.width = $popup.width(); 186 | } 187 | height = $popup.outerHeight(true) 188 | , width = $popup.outerWidth(true); 189 | 190 | calcPosition(); 191 | o.contentContainer.css({height:'auto',width:'auto'}); 192 | 193 | css.left = getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle)), 194 | css.top = getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle)); 195 | 196 | $popup 197 | .animate( 198 | css 199 | , 250 200 | , function() { 201 | content.show(); 202 | inside = insideWindow(); 203 | } 204 | ); 205 | }; 206 | 207 | function bindEvents() { 208 | $w.data('bPopup', popups); 209 | $popup.delegate('.bClose, .' + o.closeClass, 'click.'+id, close); // legacy, still supporting the close class bClose 210 | 211 | if (o.modalClose) { 212 | $('.b-modal.'+id).css('cursor', 'pointer').bind('click', close); 213 | } 214 | 215 | // Temporary disabling scroll/resize events on devices with IOS6+ 216 | // due to a bug where events are dropped after pinch to zoom 217 | if (!isIOS6X && (o.follow[0] || o.follow[1])) { 218 | $w.bind('scroll.'+id, function() { 219 | if(inside.x || inside.y){ 220 | var css = {}; 221 | if(inside.x) 222 | css.left = o.follow[0] ? getLeftPos(!fixedPosStyle) : 'auto'; 223 | if(inside.y) 224 | css.top = o.follow[1] ? getTopPos(!fixedPosStyle) : 'auto'; 225 | $popup 226 | .dequeue() 227 | .animate(css, o.followSpeed, o.followEasing); 228 | } 229 | }).bind('resize.'+id, function() { 230 | reposition(); 231 | }); 232 | } 233 | if (o.escClose) { 234 | d.bind('keydown.'+id, function(e) { 235 | if (e.which == 27) { //escape 236 | close(); 237 | } 238 | }); 239 | } 240 | }; 241 | 242 | function unbindEvents() { 243 | if (!o.scrollBar) { 244 | $('html').css('overflow', 'auto'); 245 | } 246 | $('.b-modal.'+id).unbind('click'); 247 | d.unbind('keydown.'+id); 248 | $w.unbind('.'+id).data('bPopup', ($w.data('bPopup')-1 > 0) ? $w.data('bPopup')-1 : null); 249 | $popup.undelegate('.bClose, .' + o.closeClass, 'click.'+id, close).data('bPopup', null); 250 | }; 251 | 252 | function doTransition(open) { 253 | switch (open ? o.transition : o.transitionClose || o.transition) { 254 | case "slideIn": 255 | animate({ 256 | left: open ? getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle)) : d.scrollLeft() - (width || $popup.outerWidth(true)) - buffer 257 | }); 258 | break; 259 | case "slideBack": 260 | animate({ 261 | left: open ? getLeftPos(!(!o.follow[0] && fixedHPos || fixedPosStyle)) : d.scrollLeft() + wW + buffer 262 | }); 263 | break; 264 | case "slideDown": 265 | animate({ 266 | top: open ? getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle)) : d.scrollTop() - (height || $popup.outerHeight(true)) - buffer 267 | }); 268 | break; 269 | case "slideUp": 270 | animate({ 271 | top: open ? getTopPos(!(!o.follow[1] && fixedVPos || fixedPosStyle)) : d.scrollTop() + wH + buffer 272 | }); 273 | break; 274 | default: 275 | //Hardtyping 1 and 0 to ensure opacity 1 and not 0.9999998 276 | $popup.stop().fadeTo(o.speed, open ? 1 : 0, function(){onCompleteCallback(open);}); 277 | } 278 | 279 | function animate(css){ 280 | $popup 281 | .css({display: 'block',opacity: 1}) 282 | .animate(css, o.speed, o.easing, function(){ onCompleteCallback(open); }); 283 | }; 284 | }; 285 | 286 | 287 | function onCompleteCallback(open){ 288 | if(open){ 289 | bindEvents(); 290 | triggerCall(callback); 291 | if(o.autoClose){ 292 | autoCloseTO = setTimeout(close, o.autoClose); 293 | } 294 | } else { 295 | $popup.hide(); 296 | triggerCall(o.onClose); 297 | if (o.loadUrl) { 298 | o.contentContainer.empty(); 299 | $popup.css({height: 'auto', width: 'auto'}); 300 | } 301 | } 302 | }; 303 | 304 | function getLeftPos(includeScroll){ 305 | return includeScroll ? hPos + d.scrollLeft() : hPos; 306 | }; 307 | 308 | function getTopPos(includeScroll){ 309 | return includeScroll ? vPos + d.scrollTop() : vPos; 310 | }; 311 | 312 | function triggerCall(func, arg) { 313 | $.isFunction(func) && func.call($popup, arg); 314 | }; 315 | 316 | function calcPosition(){ 317 | vPos = fixedVPos ? o.position[1] : Math.max(0, ((wH- $popup.outerHeight(true)) / 2) - o.amsl) 318 | , hPos = fixedHPos ? o.position[0] : (wW - $popup.outerWidth(true)) / 2 319 | , inside = insideWindow(); 320 | }; 321 | 322 | function insideWindow(){ 323 | return { 324 | x: wW > $popup.outerWidth(true), 325 | y: wH > $popup.outerHeight(true) 326 | } 327 | }; 328 | 329 | function windowHeight(){ 330 | return $w.height(); 331 | }; 332 | 333 | function windowWidth(){ 334 | return $w.width(); 335 | }; 336 | }; 337 | 338 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 339 | // DEFAULT VALUES 340 | //////////////////////////////////////////////////////////////////////////////////////////////////////////// 341 | $.fn.bPopup.defaults = { 342 | amsl: 50 343 | , appending: true 344 | , appendTo: 'body' 345 | , autoClose: false 346 | , closeClass: 'b-close' 347 | , content: 'ajax' // ajax, iframe or image 348 | , contentContainer: false 349 | , easing: 'swing' 350 | , escClose: true 351 | , follow: [true, true] // x, y 352 | , followEasing: 'swing' 353 | , followSpeed: 500 354 | , iframeAttr: 'scrolling="no" frameborder="0"' 355 | , loadCallback: false 356 | , loadData: false 357 | , loadUrl: false 358 | , modal: true 359 | , modalClose: true 360 | , modalColor: '#000' 361 | , onClose: false 362 | , onOpen: false 363 | , opacity: 0.7 364 | , position: ['auto', 'auto'] // x, y, 365 | , positionStyle: 'absolute'// absolute or fixed 366 | , scrollBar: true 367 | , speed: 250 // open & close speed 368 | , transition: 'fadeIn' //transitions: fadeIn, slideDown, slideIn, slideBack 369 | , transitionClose: false 370 | , zIndex: 9997 // popup gets z-index 9999, modal overlay 9998 371 | }; 372 | })(jQuery); 373 | --------------------------------------------------------------------------------