moved the attaching of resize event to the .ready method