forked from paulelliott/jquery-curtain
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjquery-curtain.min.js
8 lines (8 loc) · 1.32 KB
/
jquery-curtain.min.js
1
2
3
4
5
6
7
8
/*
* jQuery Curtain v0.5.2 - jQuery JavaScript Plugin
* Code: http://github.com/paulelliott/jquery-curtain/tree/master
*
* Copyright (c) 2009 Paul Elliott with RedLine IT
* Dual licensed under the MIT and GPL licenses.
*/
(function(b){var c={loader_image:"/images/ajax-loader.gif"};b.extend({curtainSetup:function(d){b.extend(c,d);}});b.fn.extend({curtain:function(d){if(d==="remove"){this.curtain("get").remove();return this.removeData("jquery-curtain-id");}else{if(d==="get"){var f=[];this.each(function(){f=b.merge(f,b("#"+b(this).data("jquery-curtain-id")));});return b(f);}else{d=d?d:{};var e=d.loader_image==="";d=b.extend({},c,d);if(e){d.loader_image="";}return this.each(function(){var h=b(this);var j=h.offset();var k="jquery-curtain-"+a++;h.data("jquery-curtain-id",k);var g=b("<div id='"+k+"' class='jquery-curtain'></div>").css({position:"absolute","z-index":99999,"background-color":"black",border:"1px solid black",filter:"alpha(opacity=50)","-moz-opacity":0.5,opacity:0.5,top:j.top,left:j.left,width:h.width(),height:h.height()});if(d.loader_image){var i=b("<img src='"+d.loader_image+"' alt='Loading...' style='display:none;' />");i.load(function(){i.css({position:"relative",top:((g.height()/2)-(i.height()/2))+"px",left:((g.width()/2)-(i.width()/2))+"px"}).show();});g.append(i);}b("body").append(g);});}}}});var a=0;})(jQuery);