Streaming live at 10am (PST)

Problem with embed code


#1

Hi everyone,

I am trying to embed the unorganik countup script. (you can find it here: https://inorganik.github.io/countUp.js/),

but I edited it this way:

<script>
$('.counter').each(function() {
  var $this = $(this),
  countTo = $this.attr('data-count');
  
  $({ countNum: $this.text()}).animate({
countNum: countTo
  },

  {

duration: 3000,
easing:'linear',
step: function() {
  $this.text(Math.floor(this.countNum));
},
complete: function() {
  $this.text(this.countNum);
  //alert('finished');
}

  });  
  
});

</script>

The counter works on codepen, so its not a code problem. Anyhow, I hosted the website on my server, put this script in “clocks.js”.
In the body custom code of the page, I entered this:
<script type="text/javascript" src="http://www.bourki.com/codepen/clocks.js"></script>
I did not include any CSS file since I won’t need it now.

This is the website in question:
https://preview.webflow.com/preview/geometric-0df66a?utm_source=geometric-0df66a&preview=f13b1e57aeb75d06bdb3803e1ace8360

Can someone please guide me in what im doing wrong ? The script is supposed to be affecting this section:


#2

I fixed it, apparently you dont need script code inside the .js.