Updating JS to coincide with markup/style changes