Add click listeners for linking to headings.