The nuclear polarization (NP) correction is calculated for the ground state
s of the hydrogenlike Pb-208(82) and U-238(92) ions. We take into account t
he transverse interaction, ignored in the previous studies, as well as the
Coulomb interaction. The NP correction is formulated in the bound-state QED
formalism with the ladder and cross diagrams of two-photon exchange betwee
n an electron and a nucleus. We take into account nuclear excitations of lo
w-lying states and giant resonances with multipolarities of lambda (pi) = 0
(+), 1(-), 2(+), and 3(-), and describe them in a collective model. The NP
corrections are obtained to be (-)0.2 and (-)180.7 meV, respectively for Pb
-208(82) and U-238(92). The effect of the transverse interaction is found t
o be essential to the NP correction for electric dipole giant resonances, s
trongly canceling a contribution of the Coulomb interaction. Dependence of
the NP correction on different nuclear excitations is investigated.