Added auto resize function for html5 version

Added auto resize function for html5 version.