.addClass "visited"

added .addClass("visited") everywhere where .addClass("active") is present. the visited class will not be removed, to give the change to animate elements once per visit in stead of every time the page switches.