My problem is that I need a width of an element and i get wrong result. I write in vue laravel. Here is the code:
this.timelineWidth = $('#timeline').width();
console.log(
this.timelineWidth,
document.getElementById('timeline').offsetWidth,
document.getElementById('timeline')
);
The result from console:
861 861 <ol id="timeline">…</ol>
When i check the element width myself it says it is 450px not 861. Do someone know what causes this?
Also i tried to check the width from the console and the result is good