MooTools Dots Loading Indicator


/ Published in: JavaScript
Save to your folder(s)

via [http://ryanflorence.com/mootools-for-beginners-part-5-native-extensions/](http://ryanflorence.com/mootools-for-beginners-part-5-native-extensions/)


Copy this code and paste it in your HTML
  1. window.addEvent("domready", function() {
  2. var log = $("log");
  3. var count = 0;
  4. var addDot = function() {
  5. if (count < 20) {
  6. this.set("text", this.get("text") + ".");
  7. count++;
  8. } else {
  9. log.empty();
  10. count = 0;
  11. }
  12. };
  13. var myPeriodical = addDot.periodical(50, log);
  14. (function() { $clear(myPeriodical); }).delay(4000);
  15. });

URL: http://jsfiddle.net/EXbB3/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.