Message from JavaScript discussions

December 2018

— Https://youtu.be/oe64p-QzhNE

— 

Hey guys, i wanna see the computed style of my timeline item element like this by doing console.log(window.getComputedStyle(parent, null).width);

— It gives back 940px, which is not the value i expected

— I expected "6.45312px"

— Whuts happening to me

— When i do just console.log(window.getComputedStyle(parent, null), i can see the correct width 🙈

— I thought pixel was an integer value

— Th ecomputedstyle gives an string, i solved it in a completley different, more efficient way

— Im checking the timeline scale if i show icons or not

— If you zoom 300% some page, then those float values will be relevant🤤 i prefer to use % for dimensions

Message permanent page

— Because it returns *live* object

— At the moment console.log takes .width, it's one value, at the moment you opening logged object in the console output window, it's another value...

Message permanent page