Home > Web Front-end > HTML Tutorial > Organizing common special effects on web pages: Elementary level

Organizing common special effects on web pages: Elementary level

黄舟
Release: 2016-12-23 14:52:19
Original
1122 people have browsed it

The author has accumulated many wonderful and practical web special effects over time. Almost all of these special effects are commonly used web page special effects. Now I will introduce these organized and modified special effects to you in three levels.

 Elementary Chapter

 1. Let the text keep scrolling

 <MARQUEE>Scrolling text</MARQUEE>

 2. Record and display the last modified time of the web page

 <script language=JavaScript>
 document.write("Last updated 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 after 4.2 seconds

 <script language= "JavaScript">
 <!--
 setTimeout('window.close();',2000);
 -->
 </script>

 The specified webpage will be loaded in 5.2 seconds

 <head>
<meta http-equiv="refresh" content="2;URL=http://your website">
 </head>

 6. Add to favorites

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

 7. Make hyperlinks not underlined

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

 8. Disable the right mouse button action

 <Script Language = "JavaScript">
 function click() { if (event.button==2||event.button==3)
 {
 alert('Disable the right mouse button');
  }
 document.onmousedown=click // -->
 </Script>

 9. Set this page as the homepage

 <body bgcolor="#FFFFFF" text="#000000">
 <!-- Website: http://your website-->
 <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>

The above is the content of the commonly used special effects on web pages: Elementary level. For more related content, please pay attention to the PHP Chinese website (www.php .cn)!




Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template