Basic principle of implementing a Windows-like shutdown using JavaScript
Windows shutdown result analysis
When a user in Windows shuts down, the displayed interface only allows the user to choose to shut down, unregister or cancel the action, and the programs on the desktop cannot be used, and the screen is dimmed.
In this example, the effect of the highlighted display is achieved on the webpage.
What are the benefits of using this shutdown function on the webpage? First, you can click a link to hide unavailable operations in the background, place available operations at the top of the screen, and highlight them to avoid misoperation. Second, highlight the information and remind users of the precautions.
Analysis of shutdown results on the webpage
The principle of implementing this effect on web pages is simple. Create two layers. one is the covering layer, which overwrites the entire page and is displayed in gray. The other layer is used as the highlighted part above the covering layer, this can be set by setting the z-index attribute of the layer. After the shutdown is canceled, delete the two layers on the page.
Run the following code to display the shutdown effect.
AJAX LightBox Sample
Note that in IE browser The flag cannot be overwritten, but can be overwritten in other browsers.When using the IE browserHide the element. Use the following code to hide all Element.Selects = document. getElementsByTagName ('select ');For (I = 0; I <selects. length; I ++ ){Selects [I]. style. visibility = visibility;}Code implementationClient codeThere are two links on the client page. after clicking the link, the user sends a request to the server and displays the returned information on the highlighted layer. The webpage file code of the client is as follows: AJAX LightBox