Download: Sdialog_1.0.rar
1(function($){2$. sdialog={3Showfunction(o) {4 varSet ={5Obj:NULL,6Masktrue7 };8Set =$.extend (set,o| |{});9 This. POS (set.obj);Ten if(Set.mask) This. Maskshow (); One }, AHidefunction(o) { - o.hide (); - if(!$ ('. Sdialog:visible '). Length) This. Maskhide (); the }, -Hideall:function(){ - This. Maskhide (); -$(". Sdialog "). Hide (); + }, -Openfunction(o) { + varset={ ATitle: "", atHTML: "", -URL: "", -width:500, -HeightNULL, -mark[true, -Captrue in }; -Set =$.extend (set,o| |{}); to if(Set.url) + { -Set.html= ' <iframe src= "' +set.url+ '" width= "100%" height= "' +set.height+ ' px" frameborder= "0" scrolling= "Auto" > </iframe> '; theset.height=NULL; * } $ var$win =$ (' <div class= ' Swindow ' > ');Panax Notoginseng$ (' body '). Append ($win. Append (' <div class= "SCap" ><b></b><span class= "Sclose" ></span ></div><div class= "SBox" ></div> ')); -$win. css ({"width":(set.width+ "px"), "height":(set.height+ "px")}). Find (". SCap B "). HTML (set.title); the if(Set.cap) $win. Show (). Find (". SBox "). HTML (set.html);Else$win. HTML (set.html). attr ("Class", "SWindow2"); + This. POS ($win). Find ('. Sclose '). Click (function(){$. Sdialog.hide ($win);}); A if(Set.mask) This. Maskshow (); the }, +Loadfunction(){ - This. Open ({ $HTML: ' <div class= ' sload ' ></div> ', $width:58, -Height:10, -Capfalse the }); - },WuyiLoadhode:function(){ the This. Hide ($ (". Sload "). Parent ()); - }, WuMaskshow:function(){ - vars= This; About var$mask = $ ('. Sdmask '); $ if(!$mask. Length) { -$mask = $ (' <div class= "Sdmask" ></div> "); -$ (' body '). Append ($mask); - } A if( This. IsIe6 ()) $ (' select '). Not ($ (". Sdialog "). Find (" select ") . Hide (); +$mask. Height ( This. Docheight). Show (). DblClick (function(){ the S.hideall (); - }); $ }, theMaskhide:function(){ the if($ ('. Sdmask '). Is (": Visible")){ the$ ('. Sdmask '). Hide () the if( This. IsIe6 ()) $ (' SELECT '). Show (); - } in }, thePos:function(o) { theO.addclass ("Sdialog"). css ({' position ': ' fixed ', ' top ': ' 50% ', ' Left ': ' 50% ', ' margintop ':(-math.floor (O.height ()/2)- Ten), ' MarginLeft ':-math.floor (O.width ())/2}). Show (); About if( This. IsIe6 ()) o.css ({' position ': ' absolute ', ' top ':($ (window). scrolltop () +$ (window). Height ()/2)}); the returno; the }, theDocheight:function () { + varScrollHeight, - offsetheight; the if($.browser.msie) {BayiScrollHeight =Math.max ( the Document.documentElement.scrollHeight, the Document.body.scrollHeight - ); -Offsetheight =Math.max ( the Document.documentElement.offsetHeight, the Document.body.offsetHeight the ); the - if(ScrollHeight <offsetheight) { the return$ (window). Height () + ' px '; the}Else { the returnScrollHeight + ' px ';94 } the}Else { the return$ (document). Height () + ' px '; the }98 }, AboutIsIe6:function(){ - return(typeofDocument.body.style.maxHeight = = "undefined");101 }102 }103}) (JQuery)
jquery pop-up layer plugin