function fixbgdiv(){ $('.box-one-third').css('height','auto'); $('.bg-color-fx').css('min-height','inherit'); var max_HH = 0; $('.box-one-third').each(function(){ if(max_HH <= $(this).height()) max_HH = $(this).height(); }); $('.box-one-third').css('height',max_HH+'px'); $('.bg-color-fx').css('min-height',max_HH+'px'); } $(document).ready(function(){ var wow = new WOW( { boxClass: 'wowcustom', // animated element css class (default is wow) animateClass: 'animated', // animation css class (default is animated) offset: 0, // distance to the element when triggering the animation (default is 0) mobile: true, // trigger animations on mobile devices (default is true) live: true, // act on asynchronously loaded content (default is true) callback: function(box) { setTimeout(function(){fixbgdiv();},400); }, scrollContainer: null // optional scroll container selector, otherwise use window } ); wow.init(); }); $(window).resize(function(){ fixbgdiv(); }); function commaSeparateNumber(val) { while (/(\d+)(\d{3})/.test(val.toString())) { val = val.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2'); } return val; } flag_count = true; $(window).scroll(function(){ var pos = $('#container_mc_pillole').offset(); pos = pos.top-200; if(($(this).scrollTop() > pos) && flag_count){ flag_count = false; /* COUNTER */ $('.count').each(function (n) { $('.vh_count:eq('+n+')').css('visibility','inherit'); $(this).prop('Counter',0).animate({ Counter: $(this).text() }, { duration: 4000, easing: 'swing', step: function (now) { now = Number(Math.floor(now)).toLocaleString('en'); $(this).text(now); }, complete: function(){ if(n == 0){ $(this).text("16,2"); } } }); }); /* COUNTER */ } });