JS based on Msclass and setinterval to achieve AJAX timing acquisition information and scrolling display method _javascript skills

Source: Internet
Author: User
Tags setinterval

The example of this article describes JS based on Msclass and setinterval to achieve AJAX timing acquisition information and scrolling display method. Share to everyone for your reference, specific as follows:

SetTimeout is used for a delay, only once.

SetInterval: for multiple executions.

The project refers to the jquery.timers-1.2.js timer, and Msclass do the information on a regular basis, every 3 minutes, execute three times, rolling more and more quickly, because timers and msclass are used setinterval,

Adds a setinterval, which eventually results in several setinterval concurrency, so it's very fast to clearinterval the last setinterval at the time of the call, or to reference the original method of the Msclass author.

//Timer first execute destroy instance var Marquee1 = new Marquee (["Div1", "Content"]) function Marquee_everytime ()  {Marquee1.destroy ();//Destroy Instance Application Getmarqueeinfo ();
Then Ajax collects the required information data. }//ajax Method function Getmarqueeinfo () {Lg.ajax ({type: ' Ajaxother ', Methods: ' Getmarqueeinfo ', success:funct
      Ion (data, tipscontent) {$ ("#Content"). HTML ("");
      $ ("#Content"). HTML (tipscontent); Large Container | Small container | rolling direction | rolling Speed | Width of large Container | Height of the large container | Rolling Break | Rolling Break |
     Scrolling end time marquee1.direction = 2;
     Marquee1.step = 0.4;
     Marquee1.width = 640;
     Marquee1.height = 30;
     Marquee1.timer = 20;
     Marquee1.delaytime = 4000;
     Marquee1.waittime = 3000;
     Marquee1.scrollstep = 320;
    Marquee1.start ();
    }, Error:function () {lg.tip (' information loading failed. ');
}
  }); }

More readers interested in JavaScript-related content can view this site: "JavaScript Ajax Operating Skills Summary", "JavaScript switching effects and techniques summary", "JavaScript Search Algorithm Skills summary", " JavaScript animation effects and tips Summary, "JavaScript Error and debugging skills Summary", "JavaScript data structure and algorithm skills summary", "JavaScript traversal algorithm and Skills summary" and "JavaScript Mathematical operation Usage Summary"

I hope this article will help you with JavaScript programming.

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.