javascriptcssfirepad

firepad change height in javascript


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.


Solution

  • 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.