utils.countdown.js

Delays certain processes while letting the user know when it will resume again

Responsive image

Code

Action

new UTILS.Box({ w:700, center:true, title: 'data load w/ countdown', classname: 'edit-box', html: 'data will be loaded in ', fx: { effect:'slide-down' }, onShow: function(Box){ var Box = Box; var Countdown = new UTILS.Countdown({ target:Box, duration:3, color:'red', format:'s [sec]', onStop: function(){ Box.set({ html:'starting data load...' }); } }).start(); } }).show();

API

Option

Required

Default

Description

target required $('body') DOM elm where the countdown will be inserted
duration optional 0 duration in sec of the countdown
granularity optional 1000 interval in msec by which the countdown will update the target
color optional black color of the countdown
format optional h [h] m [m] s [s] format of the display of the time
color optional black color of the background & text

API Methods

Method

Default

Repeat

Description

onTick null REPEAT stack of functions to execute when the countdown is running
onStop null REPEAT stack of functions to execute when the countdown is complete
Loading resources, please wait...