This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

BAR CHANGE SIZE 0 to 100%
#4
Set additional class is bar. This single example will work on multiple elements with the same class.
Code:
$(function(){
  if (typeof grp == 'undefined') {
    return;
  }
  
  $('.bar').each(function(index, wrapel) {
    var wrap = $(wrapel);
    var addr = wrap.data('object');
    var el = wrap.find('.icon');
    var height = el.height();
    var init = true;

    grp.listen(addr, function(object) {
      var value = Math.round(object.value * height / 100);
      el.css('overflow', 'hidden')
        .css('height', value)
        .css('margin-top', height - value);

      if (init) {
        init = false;
        setTimeout(function() {
          el.css('transition', 'height 1s linear, margin-top 1s linear');
        }, 10);
      }
    }, true);
  });
});
Reply


Messages In This Thread
BAR CHANGE SIZE 0 to 100% - by Acla - 19.02.2021, 18:12
RE: BAR CHANGE SIZE 0 to 100% - by admin - 22.02.2021, 08:26
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 24.02.2021, 09:33
RE: BAR CHANGE SIZE 0 to 100% - by admin - 24.02.2021, 11:00
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 25.02.2021, 09:27
RE: BAR CHANGE SIZE 0 to 100% - by admin - 25.02.2021, 10:21
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 28.02.2021, 11:43
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 28.02.2021, 18:41
RE: BAR CHANGE SIZE 0 to 100% - by admin - 01.03.2021, 08:24
RE: BAR CHANGE SIZE 0 to 100% - by Acla - 01.03.2021, 18:30
RE: BAR CHANGE SIZE 0 to 100% - by admin - 02.03.2021, 07:21

Forum Jump: