initial js for resize