More edits to JS in an attempted animation fix.