Some tips for doing web pages (cont.)

Source: Internet
Author: User
Tips | web | tips

Q:Double-click the automatic scrolling screen.
A:Add the following code to the page where you want the automatic scrolling

<s cript language= "Javas cript" >
var currentpos, timer;
function Initialize () {
Timer = setinterval ("ScrollWindow ()", 1);
}
function SC () {
Clearinterval (timer);
}
function ScrollWindow () {
Currentpos = Document.body.scrollTop;
Window.Scroll (0, ++currentpos);
if (Currentpos!= document.body.scrollTop) {
SC ();
}
}
Document.onmousedown = SC;
Document.ondblclick = Initialize;
&LT;/S cript>

Q:mouse effects.
A:The mouse is placed on the link will appear a description box, which has a scrolling text description

<a href= "http://xiaoguo001.nease.net" target= "_blank" > put the mouse up to try
<div id= "tooltip2" style= "Position:absolute;visibility:hidden;clip:rect (0 0); width:150px;background-color : Seashell ">
<layer name= "Nstip" width= "1000px" bgcolor= "Seashell" ></layer>
</div>
<script language= "JavaScript" >
<!--
if (!document.layers&&!document.all)
event= "Test"
function Helpor_net_show (current,e,text) {

if (document.all&&document.readystate== "complete") {
Document.all.tooltip2.innerhtml= ' <marquee style= "border:1px solid #3399ff" > ' +text+ ' </marquee> '
Document.all.tooltip2.style.pixelleft=event.clientx+document.body.scrollleft+10
Document.all.tooltip2.style.pixeltop=event.clienty+document.body.scrolltop+10
document.all.tooltip2.style.visibility= "Visible"
}

else if (document.layers) {
Document.tooltip2.document.nstip.document.write ('' +text+ '')
Document.tooltip2.document.nstip.document.close ()
Document.tooltip2.document.nstip.left=0
Currentscroll=setinterval ("Scrolltip ()", 100)
Document.tooltip2.left=e.pagex+10
Document.tooltip2.top=e.pagey+10
Document.tooltip2.visibility= "Show"
}
}
function Helpor_net_hide () {
if (document.all)
Document.all.tooltip2.style.visibility= "Hidden"
else if (document.layers) {
Clearinterval (Currentscroll)
Document.tooltip2.visibility= "Hidden"
}
}

function Scrolltip () {
if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
Document.tooltip2.document.nstip.left-=5
Else
document.tooltip2.document.nstip.left=150
}
-->
</SCRIPT>

Q:text random output that can be used as bulletin boards.
A:Script Description:
The first step: Add the following code to the <script language= "JavaScript" >
<!--Original:tarjei Davidsen (the@rescueteam.com)-->

<!--This script and many more are available free online at-->
<!--the JavaScript source!! Http://javascript.internet.com-->

<!--Begin
var max=0;
function textlist () {i++:textlist.arguments[i]; Max}
TL = new Textlist (
"With the gradual arrival of the internet age, people's understanding and perception of the network more and more profound",
"The Internet is mainly for Web page browsing, so the wonderful degree of Web pages on a website life",
"People show their talent by making a personal homepage, and because of the variety of software that makes Web pages,"
"But is it the software that makes all the pages you want?" The answer must be no, but will the software be used to create the various page effects you want? The answer is definitely no ",
"JavaScript is an interpretive language for WEB pages first introduced by Netscape"
);

var x = 0; pos = 0;
var L = tl[0].length;
function Textticker () {
Document.tickform.tickfield.value = tl[x].substring (0, POS) + "_";
if (pos++ = = L) {
pos = 0;
SetTimeout ("Textticker ()", 2000);
if (++x = = max) x = 0;
L = tl[x].length;
} else
SetTimeout ("Textticker ()", 50);
}
End-->
</script>
</HEAD>


Step Two: Add the following code to the <body> area
<form name=tickform>
<textarea Name=tickfield rows=3 cols=38 style= "Background-color:rgb (0,0,0); Color:rgb (255,255,255); Cursor:default; font-family:arial; FONT-SIZE:12PX "Wrap=virtual>the News would appear here the page has finished loading.
</textarea>
</form>


Step three: Change <body> to
<body bgcolor= "#fef4d9" >

Q:Enter the page automatically pop-up welcome speech, personal site can add ...
A:Today on the company's web site, to enter the page automatically pop-up welcome speech, personal sites can add unavoidably did not add good ah. Add the position should be able to read it.



<body>
</body>
<script language= "VBScript" >
<!--
MsgBox "Welcome to my website!" "
-->
</script>


Q:The page automatically refreshes the description.
A:When you do a Web page, do you sometimes want to let your Web page automatically constantly refresh, or a period of time to automatically jump to another you set the page? In fact, this effect is very simple, and this effect can not even be called special effects. You can just add the following code to your Web page.

1, the page automatically refreshes: The following code added to the
2, the page automatically jump: The following code added to the

< p> <>< p="">



<>

<>

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.