Let the web page automatically scroll

zhaozj2021-02-11  185

Let the web page automatic scroll screen automatic scroll screen is divided into the scrolling subtitles in the page and the entire web page automatically scroll. The scrolling subtitles in the page can be used in the page "announcement" or "latest news" and other information release, and the entire web page automatically scrolls Suitable for users to browse a network of ten-pages, eliminating the trouble of manual flipping. The implementation method of these two technologies is described below:

First, a piece of text is scrolling in the page

This method is cleverly utilizes the title element of the HTML language ... to achieve the activity subtitle effect.

The marker grammatical format is as follows:

Aligh = Left | Center | Right | TOP | BOTTOM

Bgcolor = # n

Direction = left | Right | UP | DOWN

Behavior = Type

Height = n

Hspace = n

Scrollamount = N

ScrollDelay = n

width = n

VSpace = n

Loop = n>

It can be seen that due to a variety of display modes, optional parameters are also available. Let's explain the meaning of each parameter:

Align: It is the location of the setting activity subtitles, whereby, hosted, hosted, relying on and rely on three locations.

BGColor: The background color used to set the event subtitles is usually the number of hexadecimal numbers.

Direction: The scrolling direction for setting the activity subtitles is to the left, right, upward, down.

Behavior: It is used to set the scrolling, mainly consisting of three ways: "scroll", "slide", and "alternate".

HEIGHT: Used to set the height of the scroll subtitles.

Width: Sets the width of the scrolling subtitles.

HSPACE and VSPACE: The width of the left and right borders and upper and lower frames are used to set the scrolling subtitles, respectively.

Scrollamount: The scroll distance used to set the activity subtitles.

ScrollDelay: It is used to set the delay between scrolling twice.

LOOP: Used to set the number of scrolles, when LOOP = -1 indicates, until the page is updated.

The source code of the realization is as follows:

Scrollamount = 1 scroll degiay = 20 scrollLeft = "0" scrolltop = "0">

Rolling subtitles subtitles content first line

Rolling subtitles subtitles content second line

Rolling subtitle subtitle content Third line

...

When the mouse is moved to the Marquee area, trigger the ONMOUSEOVER event, and the scroll is paused. When the mouse is moved, the ONMOUSEOUT event is triggered, and the screen will continue.

Second, the entire web page automatically scroll

Use a JavaScript code to call the scroll function to implement this feature.

Implementation:

Enter the following code COPY into the and of your html file: