Common webpage design resultsCode15 examples
1. Ignore right-click
<Body oncontextmenu = "Return false">
Or
<Body style = "overflow-Y: hidden">
2. Add background music
IE: <bgsound src = "*. Mid" loop = infinite>
NS: <embed src = "*. Mid" autostart = true hidden = true loop = true>
</Embed>
*. Mid: The MIDI format file of your background music
3. Simple window. Open Method
<A href = "#"
Onclick = "javascript: window. Open (file path/file name, newwindow,
Toolbar = No, scrollbars = Yes, resizable = No, top = 0, Left = 0,
Width = 400, Height = 300); "> text or image </a>
Parameter description:
<Script language = "JavaScript"> the JS script starts;
Window. Open command to pop up a new window;
File name in the file path/file name pop-up window;
The name (not the file name) of the newwindow pop-up window. It is optional and can be replaced by null;
Width = 400 window width;
Height = 300 window height;
Top = the pixel value between the 0 window and the top of the screen;
Left = 0 the pixel value between the window and the left of the screen;
Toolbar = No indicates whether to display the toolbar. Yes indicates display;
Menubar and scrollbars indicate the menu bar and scroll bar.
Resizable = No: whether to change the window size. Yes: Yes;
Location = No indicates whether the address bar is displayed. Yes indicates yes;
Status = No whether to display the information in the status bar (usually the file has been opened), yes is allowed;
</SCRIPT> end of JS script
4. Simple page Encryption
<Script language = "JavaScript">
<! --
Function loopy (){
VaR sword = "";
While (sword! = "Login ")
Alert ("Login successful! ");
}
Loopy ()
// -->
</SCRIPT>
5. The background image does not move when pulling the page
<Style>
Body {background-image: url(logo.gif );
Background-repeat: No-Repeat; Background-position: Center}
</Style>
6. An error occurred while saving the page by the browser.
<NoScript> <IFRAME src = "*. html"> </iframe> </NoScript>
7. Random image replacement
<SCRIPT>
Document. Write (2.16.gif "Height =" 40 "width =" 50 ">)
</SCRIPT>
The image file is named 0.gif 1.gif 2.gif 3.gif 4.gif.
8. Window timed close
Add the following code to the webpage file area:
<Script language = "JavaScript">
Function closeit () {setTimeout ("self. Close ()", 10000) // millisecond}
</SCRIPT>
Then add the following content to the <body> label: <body onload = "closeit ()">
9. Web page automatically closed
<HTML>
<Head>
<Object ID = closes type = "application/X-oleobject"
Classid = "CLSID: adb880a6-d8ff-11cf-9377-00aa003b7a11">
<Param name = "command" value = "close">
</Object>
</Head>
<Body onload = "window. setTimeout (closes. Click (), 10000)">
This window will be automatically closed 10 seconds later and will not be prompted.
</Body>
</Html>
10. Automatic Webpage refresh
Record in Head
<Meta HTTP-EQUIV = "refresh" content = "20">
The refresh is automatically refreshed 20 seconds later. You can change it to any value.
11. Automatic Webpage Conversion
<Meta HTTP-EQUIV = "refresh" content = "Time (SEC); url = address">
12. Keep the layer at the beginning without being overwritten by IFRAME and object.
Insert the IFRAME or object in the layer to set the Z-index value.
<Div Z-index: 2> <object XXX> </Object> # front
<Div Z-index: 1> <object XXX> </Object> #
<Div id = "Layer2" style = "position: absolute; top: 40; width: 400px;
Height: 95px; Z-index: 2 "> Height = 100% width = 100%>
<IFRAME width = 0 Height = 0> </iframe>
</Div>
<Div id = "layer1" style = "position: absolute; top: 50; width: 200px;
Height: 115px; Z-index: 1 ">
<IFRAME Height = 100% width = 100%> </iframe>
</Div>
13. Back to previous page
<A href = javascript: history. Back (1)> "back to previous page" </a>
14. Close Window
<A href = javascript: Self. Close ()> Close Window </a>
15. Transparent background of IFRAME
<IFRAME id = "iframe1" src = "iframe.htm"
Allowtransparency = "true"
Style = "background-color: Green"> </iframe>