1

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? enter image description here

Also i tried to check the width from the console and the result is good enter image description here

0 Answers0