check if there is a resize of the page code example
Example 1: js detect screen size change
window.onresize = function(){
console.log("resize");
}
Example 2: javascript resize event
window.resize = event => {
// Code here
};
window.onresize = function(){
console.log("resize");
}
window.resize = event => {
// Code here
};