Tips for webpage creation (continued)

Source: Internet
Author: User
Tags setinterval visibility
 
Q: Double-click automatic screen scrolling.
A: add the following code to the page for automatic screen scrolling.
<S required Language = "Javas alias">
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;
</S response>
Q: Mouse effect.
A: place the cursor over the link and A text description box appears, which contains A scroll text description.
<A href = "http://xiaoguo001.nease.net" target = "_ blank" onMouseOver = "helpor_net_show (this, event, 'Here is Guo's personal homepage ')" onMouseOut = "helpor_net_hide () "> put the mouse up and try again.
<Div id = "tooltip2" style = "position: absolute; visibility: hidden; clip: rect (0 150 50 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.doc ument. write (''+ text + '')
Document.tooltip2.document.nstip.doc ument. close ()
Document.tooltip2.doc ument. nstip. left = 0
Currentscroll = setInterval ("scrolltip ()", 100)
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.