js 锁屏

<SCRIPT LANGUAGE="JavaScript"> <!-- function lockscreen() { var sWidth,sHeight; sWidth=screen.width; sHeight=screen.height; var bgObj=document.createElement("div"); bgObj.setAttribute('id','bgDiv'); bgObj.innerHTML="<br /><br /><br /><br /><b>The Screen Lock Means That You Can't Click Any Button Or Link On The Page~!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:window.location.reload();" mce_href="javascript:window.location.reload();">unlock screen</a></b>" bgObj.style.position="absolute"; bgObj.style.top="0"; bgObj.style.background="#cccccc"; bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75"; bgObj.style.opacity="0.6"; bgObj.style.left="0"; bgObj.style.width=sWidth + "px"; bgObj.style.height=sHeight + "px"; bgObj.style.zIndex = "100"; document.body.appendChild(bgObj); } //--> </SCRIPT> <A HREF="javascript:lockscreen();" mce_HREF="javascript:lockscreen();">lockscreen();</A>

 

Demo:

function lockscreen() { /**/ var sWidth,sHeight; sWidth=screen.width; sHeight=screen.height; var bgObj=document.createElement("div"); bgObj.setAttribute('id','bgDiv'); bgObj.style.position="absolute"; bgObj.style.top="0"; bgObj.style.background="#cccccc"; bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=3,opacity=25,finishOpacity=75"; bgObj.style.opacity="0.6"; bgObj.style.left="0"; bgObj.style.width=sWidth + "px"; bgObj.style.height=sHeight + "px"; bgObj.style.zIndex = "100"; document.body.appendChild(bgObj); }

你可能感兴趣的:(JavaScript,function,div,button)