implementing click function in order to go to a slide relative to the link