Update again! MSClass (Class Of Marquee Scroll General uninterrupted rolling JS encapsulation Class Ver 1.6)

Source: Internet
Author: User

Update again! MSClass (Class Of Marquee Scroll General uninterrupted rolling JS encapsulation Class Ver 1.6)

/* MSClass (Class Of Marquee Scroll generic uninterruptible rolling JS encapsulation Class) Ver 1.6 *\

Production Time: (Ver 0.5)
Release date: (Ver 0.8)
Last Updated: (Ver 1.6)
Update Description: + added features * corrected and improved
+ Disable mouse control to pause or continue (set the 9th parameters to-1 or assign a dynamic value to set ScrollSetp to-1)
+ Determines whether the content area can be rolled (if the content area is smaller than the display area, the scrolling is automatically canceled)
+ Skip initialization error (avoid causing other scrolling stops)
+ Default value (except for the container ID, other parameters can be selected as needed)
+ Dynamic parameter value assignment (top | bottom | left | right can be expressed in the direction to make it more intuitive and convenient)
* Text scrolling is not accurate (this update mainly aims to solve this Bug. Thanks for taking part in the test by week)
+ Hover the mouse over to change the scroll direction (hover the mouse over to control the scroll left and right)
* The obtained height/width is inaccurate due to slow document download.
* Browser compatibility issues (IE, FF, Opera, NS, and MYIE)
+ Intermittent scrolling within a specified range
* Program adjustment
* Continuous intermittent rolling stop error
+ Scroll down and right
+ Start wait time
+ Continuous scrolling
* Adjust the time unit
* Rolling Error
* Random endless loop
* Enhanced Performance
* Program optimization
Continuously scroll up and left

Demo address: http://www.popub.net/script/MSClass.html
: Http://www.popub.net/script/MSClass.js

Application Description: The page contains <script type = "text/javascript" src = "MSClass. js"> </script>

Create an instance:
// Direct parameter value assignment
New Marquee ("marquee ")
New Marquee ("marquee", "top ")
New Marquee ("marquee)
New Marquee ("marquee", "top", 1,760, 5000)
New Marquee ("marquee", 760,104)
New Marquee ("marquee", null, null, 760,104, null, 5000, null,-1)

// Dynamic parameter value assignment
Var marquee1 = new Marquee ("marquee") * this parameter is required.
Marquee1.Direction = "top"; or marquee1.Direction = 0;
Marquee1.Step = 1;
Marquee1.Width = 760;
Marquee1.Height = 52;
Marquee1.Timer = 50;
Marquee1.DelayTime = 5000;
Marquee1.WaitTime = 3000;
Marquee1.ScrollStep = 52;
Marquee1.Start ();

Parameter description:
ID "marquee" container ID (required)
Ction (0) scroll Direction (optional, default: 0 scroll up) configurable values include: 0, 1, 2, 3, "top", "bottom", "left ", "right" (0 up 1 down 2 to left 3 to right)
Step (1) the scroll Step (optional, default value: 2, the larger the value, the faster the scroll)
Width (760) visible Width of the container (optional, default value: Width initially set by the container)
Height (52) visible Height of the container (optional, the default value is the initial Height of the container)
Timer (50) Timer (optional, the default value is 30. The smaller the value, the faster the scroll speed, 1000 = 1 second. It is recommended that the Timer be no less than 20)
DelayTime (5000) interval pause Delay Time (optional, default: 0, 1000 = 1 second)
WaitTime (3000) Start Time (optional, default or 0 is not waiting, 1000 = 1 second)
ScrollStep (52) interval between intermittent scrolling (optional. The default value is screen flip width/height. If the value and latency are both 0, the cursor is placed over the control, and-1 disables mouse control)
1. We recommend that you directly assign the width and height of the display area of the container, for example, (<div id = "marquee" style = "width: 760px; height: 52px; "> ...... </div>)
2. We recommend that you add the style overflow = auto for the container, such as (<div id = "marquee" style = "width: 760px; height: 52px; overflow: auto; "> ...... </div>)
3. To get the width and height of the rolling area more accurately, please assign each rolling unit the correct width and height as much as possible.
4. For horizontal scrolling of TABLE tags, you need to add the style display = inline to the TABLE, such as (<div id = "marquee" style = "width: 760px; height: 52px; overflow: auto; "> <table style =" display: inline "> ...... </table> </div>)
5. For screen flip or intermittent scrolling, pay attention to the spacing between each Rolling Unit. At the same time, set the visible height and width of the container accurately, you can adjust the spacing between each scroll unit by setting the row spacing or the height of the cell.
6. There is no better solution to the LI automatic line feed problem. We recommend that you convert it into a TABLE to achieve the same effect.
7. For text paragraphs that are horizontally scrolling, if the ending point is a space, convert the space ""
8. The concept of hovering and scrolling is derived from Flash, therefore, there are some limitations (only images with or images with Links <a> </a> are allowed in the container, and automatic line feed must be disabled)

Zhoujun # yuchengtech.com (text rolling and line skipping bug) 2007/01/31
Since the release of this program, I have received emails from many friends and raised many comments and suggestions. Thank you for your support!
Very good.

However, the new Marquee ("marquee", 3000,) parameters of the Demo code are a bit confusing:
Copy codeThe Code is as follows:
Function Marquee ()
This. ID = document. getElementById (arguments [0]);
This. Direction = arguments [1];
This. Step = arguments [2];
This. Width = arguments [3];
This. Height = arguments [4];
This. Timer = arguments [5];
This. WaitTime = arguments [6];
This. StopTime = arguments [7];
This. CTL = this. StartID = this. Stop = this. MouseOver = 0;
This. ID. style. overflowX = this. ID. style. overflowY = "hidden ";
This. ID. noWrap = true;
This. ID. style. width = this. Width;
This. ID. style. height = this. Height;
This. ID. innerHTML + = this. ID. innerHTML;

Then use:
Copy codeThe Code is as follows:
Var m = new Marquee;
M. ID = document. getElementById ("marquee ");
M. Direction = 0;
M. Step = 1;
M. Width = 760;
M. Start (m, m. Timer, m. WaitTime, m. StopTime );

The m. Start parameter seems to be related to m. Can it be omitted?

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.