O
O
olya_0972018-03-12 21:53:36
JavaScript
olya_097, 2018-03-12 21:53:36

What is the result array, more precisely, it is not clear how we got these coordinates?

What is the result array, more precisely, it is not clear how we got these coordinates?
Using JavaScript, find the coordinates of the corners indicated by the arrows relative to the browser window.
plnkr.co/edit/ryy56nfkFB7RDzw0TrBn?p=preview

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
twobomb, 2018-03-12
@twobomb

fieldCoords.left + field.clientLeft = position from window left border + element border width ( e.g. border:4px solid red;, clientLeft = 4)
fieldCoords.left + field.clientLeft + field.clientWidth= position from window left border + border width element + element width
element-size-js.png

S
Stalker_RED, 2018-03-13
@Stalker_RED

According to your link, the problem is described, and it is also solved. The text displayed by alert lists the coordinates of the four corners marked with arrows.
About the viewport is well described here https://www.quirksmode.org/mobile/viewports.html
(there is also the second part).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question