JS Mask Layer--how to make the masked link can be clicked

Source: Internet
Author: User

In the use of masking layer, found a problem, if there is a <a></a> tag linked HTML page, if you use the JS mask layer to mask this HTML page, this link is not clickable, if you want to make this link clickable, you need to be in the <a> The </a> tag adds the style attribute "position:relative;", for example:

1 <HTMLxmlns= "http://www.w3.org/1999/xhtml">2 <Head>3 <title>DIV CSS Mask Layer</title>4 <Scriptlanguage= "JavaScript"type= "Text/javascript">5 functionShowdiv () {6 document.getElementById ("BG"). Style.display="Block";7             //document.getElementById ("show"). Style.display = "block";8 }9 functionHidediv () {Ten document.getElementById ("BG"). Style.display='None'; One document.getElementById ("Show"). Style.display='None'; A         } - </Script> - <styletype= "Text/css"> the #bg{Display:None;position:Absolute;Top:0%; Left:0%;width:100%;Height:100%;background- -  - Color:Black;Z-index:1;-moz-opacity:0.7;Opacity:.;Filter:Alpha (opacity=70);} - #show{Display:None;position:Absolute;Top:25%; Left:22%;width:53%;Height:49%;padding:8px;  +  - Border:8px Solid #E8E9F7;Background-color: White;Z-index:1002;Overflow:Auto;} + </style> A </Head> at <Body> - <inputID= "Btnshow"type= "button"value= "Show"onclick= "Showdiv ();"/> - <!--<div style= "z-index:100;position:fixed" > - - <astyle= "z-index:100;position:relative;"href= "Http://www.baidu.com"> Baidu</a> - <!--</div> - - <DivID= "BG"></Div> in <DivID= "Show">Test - <inputID= "Btnclose"type= "button"value= "Close"onclick= "Hidediv ();"/> to </Div> + </Body> - </HTML>

JS Mask Layer--how to make the masked link can be clicked

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.