window.onload = function(e){ var images = document.getElementsByTagName('img'); var srcList = []; // window.alert("ok"); jQuery.noConflict(); jQuery(".mantine-Button-root").addClass('bmebutton'); jQuery(".mantine-Button-root .mantine-Button-rightIcon").html(''); jQuery("section img").each(function() { if(jQuery(this).parent().hasClass("mantine-xfrv2l")) { console.log(jQuery(this)); // jQuery(this).attr('object-fit','contain'); jQuery(this).addClass('bmefill'); } }); jQuery(".bme .count").each(function() { jQuery(this).text('0%'); }); ScrollTrigger.create({ trigger: ".bme .counter", start: "top 80%", end: "bottom bottom+=100px", onEnter: function() { countbme(); } }); // }); } // for(var i = 0; i < images.length; i++) { // srcList.push(images[i].src); // console.log(images[i].src); //} function countbme() { jQuery({ countNum: 0 }).animate({ countNum: 100 }, { duration: 3000, // tune the speed here easing: 'swing', step: function() { window.countNum = this.countNum; jQuery(".count").each(function() { if(Math.floor(window.countNum) <= parseInt(jQuery(this).attr('data-end'))){ jQuery(this).text(Math.floor(window.countNum)+'%'); } else { jQuery(this).text(jQuery(this).attr('data-end')+'%'); } }); }, complete: function() { console.log('finished'); } }); }