John Irving Whalley, 77, a former Republican representative from Pennsylvania, died of a heart attack Saturday while vacationing in Pompano Beach, Fla.

For many years he lived in Windber, Pa., where he was a businessman and active in civic affairs.

Mr. Whalley was elected to the U.S. Congress in 1960 to fill the vacancy created by the death of Douglas H. Elliott (R-Pa.). He was a high-ranking member of the House Foreign Affairs Committee. President Nixon appointed him to serve as delegate to the United Nations for the 1969 session.

In 1972 an investigation was begun into reports that he had taken kickbacks from his congressional employes and used the money to pay relatives and his own travel and business expenses.

Mr. Whalley resigned from his congressional seat in January 1973. In August of that year he pleaded guilty in U.S. District Court here to three criminal charges involving mail fraud and obstructions of justice. He was sentenced two months later to a suspended prison term, three years on probation and an $11,000 fine.

He returned to Windber, where he continued to be active in many civic affairs, including the American Red Cross, the Johnstown campus of the University of Pittsburgh, the Chamber of Commerce, the Windber Library Board and the First Presbyterian Church.

Mr. Whalley was born in Barnesboro, Pa. He attended Cambria Row Business College and became active in the automobile, banking and coal businesses.

He was chairman of the Windber Planning Commission and the Somerset County Redevelopment Authority. He served in the Pennsylvania House of Representatives in 1951-55 and in the Pennsylvania Senate in 1955-60.

He is survived by his wife, the former Ruth E. Anderson, of Windber; a son, John I. Jr., and a daughter, Ruth E. Klementik, both of Windber, and one grandchild.