Answer the question
In order to leave comments, you need to log in
Why does the native js function resize not work on Mozilla when you click on the "minimize to window" button?
Wrote the following script to adjust the auto-height
function autoHeight(object){
var fluid = object.fluid;
var subtract = object.subtract ? object.subtract : null;
function run(){
var fluidHeight = document.querySelector(fluid).offsetHeight;
var mainHeightScroll = document.documentElement.scrollHeight;
var mainHeightNoScroll = document.documentElement.offsetHeight;
if(subtract){
var subtractHeight = document.querySelector(subtract).offsetHeight;
} else{
var subtractHeight = 0;
}
if((fluidHeight + subtractHeight) <= mainHeightNoScroll){
document.querySelector('.setpassword').style.height = (mainHeightScroll - subtractHeight)+"px";
}
if((fluidHeight + subtractHeight) > mainHeightNoScroll){
document.querySelector('.setpassword').style.height = "auto";
}
}
run();
window.addEventListener('load', run);
window.addEventListener('resize', run);
}
autoHeight({
fluid: '.setpassword',
subtract: '.topbars',
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question