I´m pretty profane in javascript.
I need a previous and next link that will just go to the previous or next #anchor.
All the anchors are divs with the same ID
This is what I have managed to do:
<script type="text/javascript">
$(document).ready(function() {
// Go to the next link
function goToNext() {
window.location.href = .next('#display');
}
}
// Go to the previous link
function goToPrev() {
window.location.href = .prev('#display');
}
}
</script>
then
<a href="javascript:goToNext()">next</a>
<a href="javascript:goToPrev()" >Prev</a>
thanks!
It seems that you’re using jQuery.
You can make your ID’s to end with a number:
Then bind functions to your
nextandprevlinks that increment/decrement an index, and set thelocation.hashto the ID plus the index.