The automatic DIV scrolling function and the color modification of the scroll bar, and the color of the div scrolling scroll bar

Source: Internet
Author: User

The automatic DIV scrolling function and the color modification of the scroll bar, and the color of the div scrolling scroll bar

1. Automatic DIV scrolling

<Script type = "text/javascript">
Function startmarquee (lh, speed, delay ){
Var t;
Var oHeight = 300;/** div height **/
Var p = false;
Var o = document. getElementById ("show ");
Var preTop = 0;
O. scrollTop = 0;
Function start (){
T = setInterval (scrolling, speed );
O. scrollTop + = 1;
}
Function scrolling (){
If (o. scrollTop % lh! = 0
& O. scrollTop % (o. scrollHeight-oHeight-1 )! = 0 ){
PreTop = o. scrollTop;
O. scrollTop + = 1;
If (preTop> = o. scrollHeight | preTop = o. scrollTop ){
O. scrollTop = 0;
}
} Else {
ClearInterval (t );
SetTimeout (start, delay );
}
}
SetTimeout (start, delay );
}
Window. onload = function (){
/** Startmarquee (one rolling height, speed, stay time );**/
Startmarquee (20, 40, 50 );
}
</Script>

<Div id = "show" style = "height: 600px; width: 100%; overflow-y: scroll; scrollbar-base-color: # ffffff; SCROLLBAR-HIGHLIGHT-COLOR: # ffffff; SCROLLBAR-ARROW-COLOR: # ffffff; overflow-x: none; "> </div>

 

2. scroll bar color

Scrollbar-3d-light-color set or retrieve the highlighted border color of the scroll bar
Crollbar-highlight-color to set or retrieve the ThreedHighlight color of the 3D interface of the scroll bar
Scrollbar-face-color set or retrieve the color of the 3D surface (ThreedFace) of the scroll bar
Scrollbar-arrow-color to set or retrieve the color of the arrow in the scroll bar direction
Scrollbar-shadow-color to set or retrieve the ThreedShadow color of the 3D interface of the scroll bar
Scrollbar-dark-shadow-color to set or retrieve the ThreedDarkShadow color
Scrollbar-base-color to set or retrieve the base color of the scroll bar.

 

Note: This information is taken from the network.

 

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.