Section 2. Every city of the second class, in its corporate capacity, is authorized and empowered by ordinance:
(a) To designate certain streets as "one-way" streets, and on such streets, during any designated hours, vehicles shall move only in such direction as is specified.
(b) To close the whole or any part of any street or public highway to vehicular or animal traffic thereon, when such traffic becomes congested upon such street or public highway so as to interfere with, or become dangerous to, pedestrian travel thereon.