V
V
Vyacheslav Belyaev2015-11-08 12:46:58
JavaScript
Vyacheslav Belyaev, 2015-11-08 12:46:58

How to change block height with js?

This is generally not a difficult task, Rewrite the script to pure js without using Jquery

function reSize() {
     new_height = $("body").height() - $("#head").height() - $("#footer").height() - 44;
     $("#content").height(new_height + 'px');
}
$(window).load(reSize);
$(window).resize(reSize);

Who can help for a plus?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Deodatuss, 2015-11-08
@TroL929

var new_height = document.body.offsetHeight - document.getElementById('head').offsetHeight  -  document.getElementById('footer').offsetHeight - 44;
document.getElementById('content').style.height = new_height + 'px';

Y
Yaroslav Lyzlov, 2015-11-08
@dixoNich

stackoverflow.com/questions/10118172/setting-div-w...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question