Multi-browser-compatible page masking layer implementation

Source: Internet
Author: User

Recently, I've been working on the code in the work, accumulating some common content. Masks, as the name implies, are things that cover the page, and the common use is to wait for the page request to load, to block other actions, to prevent duplication, to wait for the previous operation to complete before removing the mask, and some picture views to use the class effect.

1CL = Common.lightbox = {2ELEMNT:NULL,3Init:function(){4         varHtml,height = ' 100% ', position = ' fixed ';5         if($.browser.msie && ($.browser.version = = "6.0") &&!$.support.style) {6Height = window.screen.availHeight + ' px ';7Position = "Absolute";8         }9         if($.browser.msie) {Tenhtml = ' <div id= ' Lightbox "style=" left:0; Background:rgb (150,150,150); top:0; width:100%; Height: ' + height + '; Filter:alpha (opacity=30); -moz-opacity:0.3; Opacity:0.3;zoom:1; Position: ' + position + '; Z-index:7; ">" One+ ' <iframe src= "" marginwidth= "0" framespacing= "0" marginheight= "0" frameborder= "0" width= "100%" height= "100%" style = "left:0; Background:rgb (255,255,255); top:0; width:100%; Filter:alpha (opacity=0); -moz-opacity:0; Opacity:0;zoom:1; Position:absolute; Z-index:9 "></iframe>" A+ ' </div> '; -}Else { -html = ' <div id= ' Lightbox "style=" left:0; Background:rgb (150,150,150); top:0; width:100%; Height: ' + height + '; Filter:alpha (opacity=30); -moz-opacity:0.3; Opacity:0.3;zoom:1; Position: ' + position + '; Z-index:7; "></div>"; the         } -          This. Element =$ (HTML). AppendTo (document.body); -          This. Count = 0; -     }, +  -Showfunction(){ +         if(! This. Element) This. Init (); A          This. Element.show (); at          This. Setzindex ("+=2"); -          This. Count < 0? This. Count = 1: This. count++; -         return  This; -     }, -  -Hidefunction(){ in         if( This. Element) { -              This. count--; to              This. Setzindex ("-=2"); +             if( This. count<=0 | | This. Getzindex () <9) -                  This. Element.hide (); the         } *     }, $Getzindex:function(){Panax Notoginseng         if( This. Element)returnparseint ( This. ELEMENT.CSS ("ZIndex")) | | -1; -     }, theSetzindex:function(zIndex) { +         if( This. Element) This. ELEMENT.CSS ("ZIndex", ZIndex | | "+=2"); A     }, theResetfunction(){ +         if( This. Element) { -              This. Count = 0; $              This. Setzindex (7); $              This. Element.hide (); -}Else{ -              This. Init (); the         } -         return  This;Wuyi     } the};

Multi-browser-compatible page masking layer implementation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.