S
S
seredaes2015-10-18 22:33:19
JavaScript
seredaes, 2015-10-18 22:33:19

What the heck with jquery?

There is such a code
aa3a0b1ec55b41538fe6ebb5d4df8191.jpg
I'm trying to get the size of the block in pixels using JQuery, but I get only percentages in response ...
050fca6e64fc42ec825f7b202723a59a.jpg
0a4ff83ad3e6493eb563982d96d76b81.jpg

To be honest, this is the first time ...
How to be? How to determine the size in pixels of the block?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Ernest Faizullin, 2015-10-18
@seredaes

apparently 100% and 100 pixels matched)

D
Dima Pautov, 2015-10-18
@bootd

Based on the screenshot, I understand this is some kind of album, which means there will be pictures. Images have a standard width and height attribute. If you set it, then jquery will get the correct width and height. And if the element is hidden, then yes, its data cannot be obtained, because even the console will not be able to visually circle it in a box for you, tk. element is missing!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question