HTML Base Code Daquan

Source: Internet
Author: User

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 your background music in MIDI format file
3. A 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 pictures </a>
Parameter explanation:
<script language= "javascript" > JS script start;
window.open the command that pops up the new window;
FileName of File path/filename pop-up window;
NewWindow the name of the pop-up window (not the file name), not necessary, available empty 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 is displayed;
Menubar,scrollbars represents the menu bar and scroll bar.
Resizable=no whether the window size is allowed to change, yes is allowed;
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 already open), yes is allowed;
</script> JS script End
4. Simple page Encryption
<script language= "JavaScript" >
<!--
function Loopy () {
var sword = "";
while (Sword! = "Login") {Sword =prompt ("Please enter your login password");}
Alert ("Login successful! ");
}
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>
7. Randomly replace pictures
<script>
document.write (+.gif "height=" "width=" >)
</script>
Image file name 0.gif 1.gif 2.gif 3.gif 4.gif
8. Window timed off
First, the following code is the area of the Web file:
<script language= "JavaScript" >
function Closeit () {settimeout ("self.close ()", 10000)//MS}
</script>
Then add in the <body> label such as: <body onload= "Closeit ()" >
9. Web page closes automatically


<object id=closes type= "Application/x-oleobject"
Classid= "Clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" >
<param name= "command" value= "Close" >
</object>

<body onload= "Window.settimeout (Closes.click (), 10000)" >
This window will automatically close after 10 seconds without prompting.
</body>

10. Web page refresh automatically
In the head section
<meta http-equiv= "Refresh" content= ">"
Where 20 is automatically refreshed after 20 seconds, you can change to any value.
11. Page automatic page turn
<meta http-equiv= "Refresh" content= "time (seconds); Url= Address" >
12. Keep layer in front, not covered by IFRAME, object
Reseat 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> # 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 Prev" </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>

HTML Base Code Daquan

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.