Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Crunching data.
- Crunching data..
- Crunching data...
- Crunching data.
- Crunching data..
- function loader(div) {
- div.append('<div id="loader"></div>');
- load = div.find('#loader');
- load.html('Crunching Some Data.');
- numberOfPeriods = 1;
- while($('#loader').length > 0) {
- setTimeout(function() {
- if(numberOfPeriods < 4) {
- numberOfPeriods++;
- for(var i=0; i<numberOfPeriods; i++) {
- load.append('.');
- }
- } else {
- load.html('Crunching Some Data.');
- numberOfPeriods = 1;
- }
- }, 200);
- }
- }
- function showLoader() {
- var load;
- load = $('<div id="loader"></div>');
- $(document.body).append(load);
- load.html('Crunching Some Data.');
- numberOfPeriods = 1;
- interval = setInterval(function(){
- if(numberOfPeriods < 4)
- {
- load.html(load.html() + '.');
- numberOfPeriods++;
- }
- else
- {
- load.html('Crunching Some Data.');
- numberOfPeriods = 1;
- }
- }, 200);
- }
- function hideLoader(){
- clearInterval(interval);
- $('#loader').remove();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement