const fireOnThis = document.getElementsByTagName('body') const evObj = document.createEvent('MouseEvents') evObj.initMouseEvent('resize', true, true, window) fireOnThis[0].dispatchEvent(evObj)