1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 4 <Head>5 <MetaCharSet= "UTF-8">6 <Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0">7 <Metahttp-equiv= "X-ua-compatible"content= "Ie=edge">8 <Scriptsrc= "Http://libs.baidu.com/jquery/2.1.1/jquery.min.js"></Script>9 <Scriptsrc= "Https://cdn.bootcss.com/layer/3.1.0/mobile/layer.js"></Script>Ten <Scriptsrc= "Https://cdn.bootcss.com/layer/3.1.0/mobile/need/layer.css"></Script> One <title>Document</title> A </Head> - - <Body> the <ButtonID= "Mask">Click the pop-up window</Button> - - <Script> - (function () { + $('#mask'). On ('Click', function () { - //Inquiry Box + //for more information on use, please visit: http://layer.layui.com/mobile/ A Layer.open ({ at content:'Are you sure you want to refresh this page? ' - , btn: ['Refresh', 'Don't'] - , yes:function(index) { - location.reload (); - layer.close (index); - } in }); - }); to })(); + </Script> - </Body> the * </HTML>
Layer.js use of mobile pop-up windows