This article describes the method of JS to collect information regularly and display it scrolls based on MSClass and setInterval. Share it for your reference, as follows:
setTimeout is used for delays and is executed only once.
setInterval: Used for multiple executions.
The project references the -1. timer, and MSClass does information scrolling regularly, executing every 3 minutes, about three times, and the number of scrolling is getting faster and faster. The reason is that both times and MSClass use setInterval,
A setInterval will be added again, which will eventually lead to several setInterval being executed concurrently, so the speed is very fast. You need to clear the last setInterval when calling, or refer to the original method of the MSClass author.
//Execute the timer first. Destroy the instancevar Marquee1 = new Marquee(["div1", "Content"]) function Marquee_everyTime() { (); //Destroy the instance application GetMarqueeInfo(); //Then ajax collects the required information and data.} //ajax methodfunction GetMarqueeInfo() { ({ type: 'AjaxOther', method: 'GetMarqueeInfo', success: function (data, tipsContent) { $("#Content").html(""); $("#Content").html(tipsContent); //Large container | Small container | Rolling direction | Scroll speed | Width of large container | Height of large container | Scroll rest time | Scroll rest time | Scroll end time = 2; = 0.4; = 640; = 30; = 20; = 4000; = 3000; = 320; (); }, error: function () { ('Information loading failed.'); } }); }
For more information about JavaScript, readers who are interested in reading this site's special topic:Summary of ajax operation skills in JavaScript》、《Summary of JavaScript switching effects and techniques》、《Summary of JavaScript search algorithm skills》、《Summary of JavaScript animation special effects and techniques》、《Summary of JavaScript Errors and Debugging Skills》、《Summary of JavaScript data structure and algorithm techniques》、《JavaScript traversal algorithm and skills summary"and"Summary of JavaScript mathematical operations usage》
I hope this article will be helpful to everyone's JavaScript programming.