Details about HTML scrolling subtitle code and parameters, and details about scrolling subtitle Parameters
Html text scrolling code
<Marquee style = "WIDTH: 388px; HEIGHT: 200px "scrollamount =" 2 "ction =" up "> <div align =" left "> <br/> </div> <center> <font face =" "color = "#008000" size = "4"> </font> </center> <div align = "left"> <br/> </div> <center> <p> <font color = "# ff6600" size = "4"> scroll text </font> </p> <font color = "# ff4500" size = "4 "> scroll text </font> </p> <font color =" # ff3300 "size =" 4 "> scroll text </font> <br/> <br/> </p> </marquee>
Marquee parameters:
BGColor: the background color of the scroll text box.
Direction: Set the scroll Direction. You can select Left, Right, up, and down.
Scrolldelay: the delay time between each scroll.
Scrollamount: the total time of a rolling. The smaller the number, the slower the rolling.
Behaviour: Set the Scroll mode. Three values are: Scroll (Cyclic Scroll) lide (single Scroll) AND Alternate (back-and-forth Scroll ).
Align: Specifies the Align of text. You can select "Middle", "Bottom", or "Top ).
Width: the Width of the scroll text box. after entering a value, select in Pixels (by pixel) or in Percent (by percentage) from the following single pixel ).
Height: the Height of the scroll text box. after entering a value, select in Pixels (by pixel) or in Percent (by percentage) from the following single pixel ).
Loop: Number of scrolling times. The default value is infinite.
Hspace and vspace: Empty rows between front and back, and between top and bottom.
Many people are excited by rolling subtitles, especially when they are used for the first time. I also did a lot of work on rolling subtitles, so I am not very excited about it, so I am not using much now. Many of my friends often asked how this was done. Now I am working on a detailed topic to give you a more comprehensive understanding.
Rolling subtitles are included in the FrontPage component. However, the FrontPage software supports only one line of text. When multiple lines of text appear, it cannot do anything, and it can only support one line of scrolling! (If only one row can be rolled, the solution is to embed this code into the document of JavaScript. write, see the following example d for details) Dreamweaver can only be used to compile HTML code. Therefore, we strongly recommend that you use NotePad to open the webpage source code for editing.
1. Create the first rolling subtitle. Code:
<Marquee scrollAmount = 2 width = 300> beautiful scenery </marquee>
Effect: Beautiful scenery
2. parameters:
A) scrollAmount. It indicates the speed. The greater the value, the faster the speed. If you do not have it, the default value is 6. We recommend that you set it to 1 ~ 3 is better.
B) width and height indicate the size of the rolling area, width indicates the width, and height indicates the height. Especially when performing vertical scrolling, you must set the height value.
C) direction. Indicates the scroll direction. The default value is "scroll left. Optional values include right, down, and up. The scroll direction is: right, →, up, and down, respectively.
D) scrollDelay, which is also used to control the speed. The default value is 90. The larger the value, the slower the speed. Generally, scrollDelay does not need to be set.
E) behavior. It is used to control attributes. The default value is circular scrolling. Optional values include alternate (alternate scrolling) and slide (slide effect, which means scrolling once and then stopping scrolling)
3. instance:
A) How do I add hyperlinks to rolling subtitles? This is exactly the same as the usual hyperlink. You only need to add <a href = ***> and </a> to the text. The following effect, the code is <marquee scrollAmount = 2 width = 300> <a href = http://www.cctv.com> CCTV </a> </marquee>, click on CCTV to enter:
CCTV
B) How do I make the text to stop scrolling when the mouse stays on the text?
The Code is as follows:
<Marquee scrollAmount = 2 width = 300 onmouseover = stop () onmouseout = start ()> text content </marquee>
The effect is as follows:
Text Content
C) Alternate effect. The Code is as follows:
<Marquee scrollAmount = 2 width = 99 behavior = alternate> text content </marquee>
The effect is as follows:
Text Content
D. Scroll up multiple lines of text. The Code is as follows:
<Marquee scrollAmount = 2 width = 300 height = 160 ction = up> · good morning! <Br> · fresh air <br> · Are you okay <p> · <a href = http://www.cctv.com> beautiful scenery </a> </marquee>
The effect is as follows:
· Good morning!
· The air is fresh.
· Are you okay?
· Beautiful scenery
· Note: If your webpage is edited by FrontPage, you can only scroll one row after it is saved. At this time, you find that the order of your original code has changed, My god! The solution is to find out the original code and embed it into document. write in JavaScript. write the Code as follows:
<Script> document. write ('<marquee scrollAmount = 2 width = 300 height = 160 ction = up> · good morning! <Br> · fresh air <br> · Are you okay <p> · <a href = http://www.cctv.com> beautiful scenery </a> </marquee> ') </script>
E) how to change the color of the scrolling subtitles? You can use a style sheet for control. The code is <marquee scrollAmount = 2 width = 300> <a style = color: CC6600> Are you okay </a> </marquee>.
Are you okay?
Image scrolling
Use the statement. Note that the image name must not be Chinese characters. The image name must be case sensitive.
Hyperlinks for images
Use <a href => and </a> to enclose , and set img to border = 0. Otherwise, a blue box is displayed. The correct example is: & amp; lt; a href = http://www.webshu.com> </a>
A href = indicates a hyperlink, which is the most common one. The practice method is also very simple, that is, when using FP or DW for Web pages, you need to view more source code.
Arrange and scroll multiple images
Generally, <br> or <p style = margin-top: 9> (precisely adjust the distance between images) is used between images. You can also typeset your image with a table, and then add all the statements of the table to marquee for scrolling.
Code <script> document. write ('<marquee scrollAmount = 2 width = 340 height = 160 ction = up onmouseover = stop () onmouseout = start ()> <a href = http://www.webshu.com> </a> </marquee> ') </script>
Link: http://blog.sina.com.cn/s/blog_4ba2ac620100iv36.html