Added handlers for load and resize events.