SoFunction
Updated on 2025-04-10

Class Of Marquee Scroll Universal Uninterrupted Scroll JS Encapsulation Class Page 1/2

Production time: 2006-08-29 (Ver 0.5)
Release time: 2006-08-31 (Ver 0.8)
Update time: 2007-12-28 (Ver 1.65)
Update instructions: + Add function * Correct and improve
    1.65.071228
* Horizontal and vertical scroll format adjustment (solve the problem of horizontal scrolling and line wrapping, no special settings are required)
* Completely solve the problem of scrolling up and down page blank due to IE problems (This update mainly solves this problem, thanks to the scholars in the sky for participating in the test)
    1.6.070131
+ Disable mouse control pause or continue (set the 9th parameter to -1 or dynamic assignment to ScrollSetp to -1)
+ Determine whether scrolling can be done (if the content area is smaller than the display area, scrolling will be canceled automatically)
+ Skip the initialization error (avoid other scrolling stops)
+ Default value (except for the container ID, other parameters can be selected and set according to the situation)
+ Dynamic assignment of parameters (the direction can be expressed in English as top|up|bottom|down|left|right, making it more intuitive and convenient)
* The text scrolling is inaccurate (the main purpose of this update is to solve this bug, thanks to Zhou Jun for participating in the test)
    1.4.061211
+ Mouse hover changes the scrolling direction (mouse hover controls scrolling left and right)
* The height/width obtained is inaccurate due to slow document download
* Browser compatibility issues (IE, FF, Opera, NS, MYIE)
    1.2.060922
+ Intermittent scrolling in the specified range
* Program adjustment
* Error of continuous intermittent scrolling stop
    1.0.060901
+ Scroll down and right
+ Start waiting time
+ Continuous scrolling
* Adjust the time unit
* Rolling error
* Random dead loop
* Strengthen performance
* Program Optimization
    0.8.060829
Flip the screen continuously and scroll to the left
[code]
<!--
/*MSClass (Class Of Marquee Scroll General uninterrupted scrolling JS encapsulation class) Ver 1.65*\

Production time: 2006-08-29 (Ver 0.5)
Release time: 2006-08-31 (Ver 0.8)
Update time: 2007-12-28 (Ver 1.65)
Update instructions: + Add function * Correct and improve
    1.65.071228
* Horizontal and vertical scroll format adjustment (solve the problem of horizontal scrolling and line wrapping, no special settings are required)
* Completely solve the problem of scrolling up and down page blank due to IE problems (This update mainly solves this problem, thanks to the scholars in the sky for participating in the test)
    1.6.070131
+ Disable mouse control pause or continue (set the 9th parameter to -1 or dynamic assignment to ScrollSetp to -1)
+ Determine whether scrolling can be done (if the content area is smaller than the display area, scrolling will be canceled automatically)
+ Skip the initialization error (avoid other scrolling stops)
+ Default value (except for the container ID, other parameters can be selected and set according to the situation)
+ Dynamic assignment of parameters (the direction can be expressed in English as top|up|bottom|down|left|right, making it more intuitive and convenient)
* The text scrolling is inaccurate (the main purpose of this update is to solve this bug, thanks to Zhou Jun for participating in the test)
    1.4.061211
+ Mouse hover changes the scrolling direction (mouse hover controls scrolling left and right)
* The height/width obtained is inaccurate due to slow document download
* Browser compatibility issues (IE, FF, Opera, NS, MYIE)
    1.2.060922
+ Intermittent scrolling in the specified range
* Program adjustment
* Error of continuous intermittent scrolling stop
    1.0.060901
+ Scroll down and right
+ Start waiting time
+ Continuous scrolling
* Adjust the time unit
* Rolling error
* Random dead loop
* Strengthen performance
* Program Optimization
    0.8.060829
Flip the screen continuously and scroll to the left

Application Note: The page contains <script type="text/javascript" src=""></script>

Create an instance:
//Direct parameter assignment method
        new Marquee("marquee")
        new Marquee("marquee","top")
        ......
        new Marquee("marquee",0,1,760,52)
        new Marquee("marquee","top",1,760,52,50,5000)
        ......
        new Marquee("marquee",0,1,760,104,50,5000,3000,52)
        new Marquee("marquee",null,null,760,104,null,5000,null,-1)

//Dynamic parameter assignment method
var marquee1 = new Marquee("marquee")    *This parameter is required
= "top";    or    = 0;
         = 1;
         = 760;
         = 52;
         = 50;
         = 5000;
         = 3000;
         = 52;
        ();

Parameter description:
ID         "marquee"       Container ID          (Required)
Direction    (0)
Step        (1)                                                     �
Width        (760)                                                                                                                   �
Height        (52)                                                                                                                    �
Timer         (50)           Timer                                  Timer                                   Timer                                �
DelayTime     (5000)
WaitTime    (3000)            WaitTime at the beginning (optional, default or 0 is not waiting, 1000=1 second)
ScrollStep    (52)          Intermittent scrolling spacing    (Optional, default is the screen flip width/height. If this value and delay are 0, it is mouse hover control, and -1 prohibits mouse control)

Suggestions for use:
1. It is recommended to directly assign the width and height of the display area of ​​the container, such as (<div  style="width:760px;height:52px;">......</div>)
2. It is recommended to add style overflow = auto to the container, such as (<div  style="width:760px;height:52px;overflow:auto;">......</div>)
3. In order to obtain the width and height of the scrolling area more accurately, please directly assign each scrolling unit to the correct width and height as much as possible.
4. For horizontal scrolling of TABLE marks, you need to add style display = inline to TABLE, such as (<div  style="width:760px;height:52px;overflow:auto;"><table style="display:inline">......</table></div>)
5. For screen rolling or intermittent scrolling, pay attention to the spacing between each scrolling unit. At the same time, it is necessary to accurately set the visual height and visual width of the container. The spacing between each scrolling unit can be adjusted by setting the row spacing or the height width of the cell.
6. There is no better solution to the problem of LI automatic line wrapping. It is recommended to convert it into a form (TABLE) to achieve the same effect.
7. For horizontally scrolling text paragraphs, if the end ends with a space "", please convert the space "" to "&nbsp;"
8. The idea of ​​mouse hover scrolling comes from Flash, so it has certain limitations (only images <img> or images with links are allowed to be in the container, and their automatic line wrapping is prohibited)

grateful:
The scholar in the sky (QQ: 30370740) (Bug on blank space on IE page) 2007/12/22
Zhou Jun zhoujun# (bug of text scrolling jump) 2007/01/31
Since the release of this program, I have received many emails from friends and put forward many opinions and suggestions. Thank you for your support!

12Next pageRead the full text