I've managed to work out how to make my code apply specifically to an individual link. I found out how to use $(this)
Thanks anyway! All I need now is to figure out the syntax of moving my script over into a separate .js file instead of being inline.