Common special effects on webpages: Preliminary

Source: Internet
Author: User

1. Keep text scrolling

<MARQUEE> scroll text </MARQUEE>

2. Record and display the last modification time of the webpage

<Script language = JavaScript>
Document. write ("Last Update time:" + document. lastModified + "")
</Script>

3. Close the current window

<A href = "/" onClick = "javascript: window. close (); return false;"> close the window </a>

Close the current page in 4.2 seconds

<Script language = "JavaScript">
<! --
SetTimeout (window. close ();, 2000 );
-->
</Script>

Load the specified webpage in 5.2 seconds

<Head>
<Meta http-equiv = "refresh" content = "2; URL = http: // your URL">
</Head>

6. Add to favorites

<Script Language = "JavaScript">
Function bookmarkit ()
{
Window. external. addFavorite (http: // your website, your website name)
}
If (document. all) document. write (<a href = "#" onClick = "bookmarkit ()"> Add to favorites </a>)
</Script>

7. Leave the hyperlink ununderlined

<Style type = "text/css">
<! -
A: link {text-decoration: none}
A: hover {text-decoration: none}
A: visited {text-decoration: none}
->
</Style>

8. prohibit right-click actions

<Script Language = "JavaScript">
Function click () {if (event. button = 2 | event. button = 3)
{
Alert (right-click prohibited );
}
Document. onmousedown = click // -->
</Script>

9. Set this page as the homepage

<Body bgcolor = "# FFFFFF" text = "#000000">
<! -- URL: http: // your url -->
<A class = "chlnk" style = "cursor: hand" HREF
OnClick = "this. style. behavior = url (# default # homepage );
This. setHomePage (your website name); "> <font color =" 000000 "size =" 2 "face =" "> set as homepage </font> </a>
</Body>

Related Article

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.