Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A utility funciton used to run a class method on a periodical.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 Assets
Octocat-spinner-32 Demos
Octocat-spinner-32 Docs
Octocat-spinner-32 Source
Octocat-spinner-32 README.md
Octocat-spinner-32 package.yml
README.md

Loop

Loop

A Utility Class. Its methods can be implemented with Class-implement into any Class. Used to run a class method on a periodical.

Useful in galleries, slideshows, tickers, sprite animations, pulsing, logout scripts, etc. Anything that needs to run the same function repeatedly.

How to use

Example:

#JS
var Widget = new Class({

  Implements: Loop,

  initialize: function(log){
    this.setLoop(this.update, 1000);
    this.log = document.id(log);
  },

  update: function(count){
    this.log.set('text',"Looped " + count + " times");
  }

});

var myWidget = new Widget('log').startLoop();

View the MooDoc for usage and examples.

Something went wrong with that request. Please try again.