When any sidewalks are constructed, every person who rides or drives a horse, team or other vehicle on the sidewalks, except for the purpose of crossing the sidewalks when necessary to do so, or who hitches any horse or other animal to any tree growing on or adjacent to such sidewalks, commits a Class C misdemeanor.