D
D
DROS2015-11-11 16:32:06
css
DROS, 2015-11-11 16:32:06

How to set max-height to div with position: absolute?

Good afternoon.
There is an absolutely positioned DIV (this is important) that contains a JS accordion that can be insanely tall when expanded. It is necessary to set the diva to the maximum height = screen height, so that when the chord is expanded, the entire sheet does not go down the page.
So, max-height : 100% in absolute does not shoot, but it is very necessary.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mr_dev1l, 2015-11-11
@mr_dev1l

var height = $(window).height();
$(".accrodion").css("height", height);

M
Mikhail, 2015-11-11
Chirskiy @chirskiy_mixail

As an option, file a function that checks the screen height, put it in resize and add this value to max-height.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question