U
U
UnexpectedMan2020-05-03 20:11:08
JavaScript
UnexpectedMan, 2020-05-03 20:11:08

How to calculate the exact value of dashoffset and dashoffaray?

I tried in two ways, but nothing comes out in the console. No errors:

function TotalLength(){
  var path = document.querySelector('#check');
  var len = Math.round(path.getTotalLength() );
  alert("Длина пути - " + len);
};

var path = document.querySelector('.squiggle-container path');
console.log(path.getTotalLength());

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question