Bear with me while I try my best to explain what I need 🙂
We have 3 links that are pointing to anchors further down the page, like this:
<a href="#step1">Step 1</a> which goes to <div id="#step1">
<a href="#step2">Step 2</a> which goes to <div id="#step2">
<a href="#step3">Step 3</a> which goes to <div id="#step3">
So what I’m trying to do is dynamically target the element that I’m going to. So if I click on the Step 1 link, I go down to the div with an id of step1, but use jQuery to select the targeted element (the div with an id of step1).
So this snippet doesn’t work, but is on the right path I think:
$(this).effect("highlight", {}, 3000);
…which selects the link that I clicked on – not right! I want to select the element that I’m targeting in that link. Get it? Now, I know I could hard code it, but there HAS to be a way to dynamically target what I want.
If this doesn’t make any sense, I’m sorry. I would love any and all help and feedback.
Thanks!
http://jsfiddle.net/b9nub/
PS: note that you don’t need to use
#in theidvalue, so