startMarquee
Note 1: The marquee effect implemented with the following interfaces does not support refreshing through the "Report Block Refresh Plugin in Dashboard".
Method | startMarquee(opt) | Turn on the marquee effect |
---|---|---|
Parameter | opt: { offset: number, interval: number, stopOnHover: boolean, to: string } | Scrolling effect attributes, json format offset: the distance of each scroll, the default is 5px, the unit is px interval: interval duration, the default is 0.1s, the unit is s stopOnHover: Whether to pause when the mouse is hovered, the default is true
to: the direction of scrolling, supports up and left, the default is up
|
Return value | void | |
Example | Example 1: If the obtained report block object is defined as report, implement the default marquee effect (5px scroll every 0.1s, pause when the mouse is hovered) Example 2: Implementing the default marquee effect in a general report Example 3: Add a default marquee effect to the report0 report block in the dashboard
Note: When the code is added in the "after initialization" event, it is recommended to add a delay function, otherwise an error may occur because the report block object is not fully created. An example is as follows:
Example 4: Scroll 2 px to the left every 0.3s in a general report, without pausing when the mouse is hovered
Example 5: The report0 report block in the dashboard scrolls 2 px to the left every 0.3s, and does not pause when the mouse is hovered
| |
Application example | The report block implements the default marquee effect, and stops scrolling when the mouse hovers: Click to download the template: | |
Mobile | Not support mobile terminal |
stopMarquee
Method | stopMarquee() | Turn off the marquee effect |
---|---|---|
Parameter | - | - |
Return value | void | |
Example | Example 1: If the obtained report block object is defined as report, turn off the marquee effect set by startMarquee() Example 2: Turn off the marquee effect set by startMarquee() in a general report Example 3: Turn off the marquee effect of the report0 report block in the dashboard _g().getWidgetByName('report0').stopMarquee(); | |
Application example | The report block realizes the marquee effect, click the "Turn off" button to turn off the marquee effect: Click to download the template: | |
Mobile | Not support mobile terminal |