Answer the question
In order to leave comments, you need to log in
"Rubberness" js elements?
Is there a way to detect that the size of some page element is given in %? in the DOM, as I understand it, already calculated values \u200b\u200bare stored, which are automatically recalculated during resize.
You can put the question differently: is it possible in any way to change such automatically calculated dimensions without losing the “rubberness”?
Answer the question
In order to leave comments, you need to log in
Why does a rubber element need to be dimensioned?
It will be rubber as long as its dimensions are defined as a percentage. Therefore, in order for the element to remain rubber, the dimensions must be set in%.
If I understand correctly, then:
we find the width of the browser window (WBx) in pixels, we take the value as 100%. Wpx/100=value_of_percentage_in_pixels (VP). Find the width of the desired element in pixels (WHE).
SH/VP=percentage_of_element_width_to_window_width.
Recently I did this - I don’t have ready-made code at hand, but I’ll say that it’s done on JQuery once or twice.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question