class="layui-nav-item"> <a href="javascript:; " id="lock"> class="Iconfont Icon-diannao1"></i> lock Screen </a></li>
<Divclass= "Lock-screen"style= "Display:none;"> <DivID= "Locker"class= "Lock-wrapper"> <DivID= "Time"></Div> <Divclass= "Lock-box Center"> <imgsrc= "/static/images/user.jpg"style= "width:100px;height:100px;"alt=""> <H1>Admin</H1> <Duvclass= "Form-group col-lg-12"> <inputtype= "Password"placeholder= ' Lock screen status, please enter password to unlock 'ID= "Lock_password"class= "Form-control lock-input"Autofocus Name= "Lock_password"> <ButtonID= "Unlock"class= "Btn Btn-lock">Unlock</Button> </Duv> </Div> </Div></Div>
//shortcut key lock screen settings$ (document). KeyDown (function(e) {if(E.altkey && E.which = = 76) {Locksystem (); } }); functionStarttimer () {vartoday=NewDate (); varH=today.gethours (); varm=today.getminutes (); vars=today.getseconds (); M= M < 10? ' 0 ' +m:m; S= S < 10? ' 0 ' +s:s; $(' #time '). html (H + ":" +m+ ":" +s); varT=settimeout (function() {Starttimer ()},500); } //lock screen Status detection functionChecklockstatus (locked) {//Lock Screen if(Locked = = 1){ $('. Lock-screen '). Show (); $(' #locker '). Show (); $(' #layui_layout '). Hide (); $(' #lock_password '). Val ('); }Else{ $('. Lock-screen '). Hide (); $(' #locker '). Hide (); $(' #layui_layout '). Show (); }} checklockstatus (' 0 '); //Lock Screen functionLocksystem () {varurl = ' '; $.post (URL,function(data) {if(data) {Checklockstatus (1); }Else{Layer.alert (' Lock screen failed, please try again later! ‘); } }); Starttimer (); } //Unlocking the screen functionUnlocksystem () {//The code with the background interaction has been removed, and this feature is defined or removed as requiredChecklockstatus (0); } //Click on the lock screen$ (' #lock '). Click (function() {Locksystem (); }); //Unlock Access System$ (' #unlock '). Click (function() {Unlocksystem (); }); //monitoring Lock_password keyboard Events$ (' #lock_password '). KeyPress (function(e) {varKey =E.which; if(Key = = 13) {Unlocksystem (); } });
JS anti-WinDOS lock screen function realization