A landmark swing bridge in a North Yorkshire coastal town is to be pedestrianised during peak tourism periods, the council has said.