9elements / loadie.js

Loadie.js is a lightweight jQuery plugin to create a preloader that doesn't suck and that is used by big firms.
http://9elements.github.io/loadie.js/
MIT License
399 stars 93 forks source link

Reuse the same loadie #3

Open david90 opened 10 years ago

david90 commented 10 years ago

After calling $("body").loadie(1.0), display is set to none, At that moment , if we call $("body").loadie(0.3), the loadie is not shown

jimbooslice commented 10 years ago

Not sure if you figured it out, but I did have the same issue. I added

loadie.show();

before the it modifies the width of the element In Line 26 in jquery.loadie.js

  Loadie.update = function(dom, percent) {
      var loadie = $('#loadie-' + dom.data('loadie-id'), dom);
      var parentWidth = dom.width();
      loadie.show(); //<-- this is where I added it
      loadie.css('width', Math.floor(percent * parentWidth) + "px");
  }