offsetWidth did not work in fronont end so change panelSize calculation