Design | Web Page design
1. Ignore right button
<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 MIDI format file for your background music
3. A simple window.open method
<a href= "#"
> Text or pictures </a>
Parameter explanation:
<script language= "javascript" > JS script started;
window.open the command to eject a new window;
FileName of File path/filename pop-up window;
NewWindow pop-up window name (not file name), not required, available NULL instead;
width=400 window width;
height=300 window height;
The pixel value of the Top=0 window from the top of the screen;
The pixel value of the left=0 window from the left side of the screen;
Toolbar=no whether the toolbar is displayed, yes for display;
Menubar,scrollbars represents the menu bar and scroll bar.
Resizable=no whether to allow changes to the window size, yes to allow;
Location=no whether the address bar is displayed, yes is allowed;
Status=no whether the information in the status bar is displayed (usually the file is open), yes to allow;
</SCRIPT> JS script End
4. Simple page Encryption
<script language= "JavaScript" >
<!--
function Loopy () {
var sword = "";
while (sword!= "login")
Alert ("Landing success!") ");
}
Loopy ()
-->
</script>
5. The background image does not move when the page is pulled
<style>
Body{background-image:url (logo.gif);
Background-repeat:no-repeat;background-position:center}
</style>
6. Allow the browser to save the page when saving failed
<noscript><iframe src= "*.html" ></iframe></NOSCRIPT>
7. Replace pictures randomly
<script>
document.write (+.gif "height=" width= "" >)
</script>
Picture file name is 0.gif 1.gif 2.gif 3.gif 4.gif
8. Window timed off
First, the area of the following code page file:
<script language= "JavaScript" >
function Closeit () {settimeout ("self.close ()", 10000)//MS}
</script>
And then add the <body> mark as: <body >
9. Web page automatically closes
<object id=closes type= "Application/x-oleobject"
Classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "Command" value= "Close" >
</object>
<body >
This window will automatically close after 10 seconds without prompting.
</body>
10. Automatic Web page Refresh
In the head department.
<meta http-equiv= "Refresh" content= ">"
20 is automatically refreshed after 20 seconds, and you can change to any value.
11. Page Auto Page transfer
<meta http-equiv= "Refresh" content= "time (seconds); Url= Address ">
12. Keep layer at the front without being covered by an IFRAME or object
Insert an 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> # behind
<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. About the transparent background of the IFRAME
<iframe id= "iFrame1" src= "iframe.htm"
Allowtransparency= "true"
Style= "Background-color:green" ></IFRAME>