// browser to monitor changes in the size $ (window) .resize (function ( ) {// change the size of the panel when the browser size changes document.getElementById ( "layui-card2") . Style.height = (document.getElementById ( " card1-layui. ") 20 is the offsetHeight-) +" PX "; });