I have a series of horizontal div boxes that I need to add the relevant href to link to the next one with anchorlinks. As they are produced dynamically I need to add the href with JavaScript.
The desired effect will be:
<div id="post1">
<a class="next-video" href="#post2">NextVideo</a>
</div>
<div id="post2">
<a class="next-video" href="#post3">NextVideo</a>
</div>
Added the script
$('.next-video').each(function(index) {
$(this).attr('href', '#post' + (index + 2));
});
but doesn't seem to target the .next-video class, this is the live version:
http://www.warface.co.uk/clients/detail-shoppe/test-scroll
Many thanks