handles window's width change for responsive web design.