Custom cross-browser smartresize() event