firepad change height in javascript

93 views Asked by At

Firepad documentation says that height is set through css rule:

.firepad {
    height: 500px;
}

But is it possible to set it in javascript? I want to set the height based on browser window's height.

1

There are 1 answers

0
karliwson On BEST ANSWER

You can try:

With jQuery:

$('.firepad').css('height', '500px');

Without jQuery:

document.querySelector('.firepad').style.height = '500px';

If you want to resize both the editor and users list, just replace .firepad with #firepad-container.

Just do your calculations relative to the browser window's height and use one of these two methods.