Frame sizing with JS