Added an onResize event

I think it could be useful sometimes. But it could also be dangerous...