]So im basically using a link, to scroll through a series of divs to select the correct one.
Ie click on happy, and scrolls to 'happy' div,
However, the scroll seems to not go to what its linked to, but scrolls to the third div in the list.
Heres the code:
Ie click on happy, and scrolls to 'happy' div,
However, the scroll seems to not go to what its linked to, but scrolls to the third div in the list.
Heres the code:
HTML:
<div id="portfoliowrapper">
<div id="row1"><a id="kazooki" href="#">Kazooki</a></div>
<div id="row1"><a id="UoD" href="#">Universe of Downhill</a></div>
<div id="row1"><a id="kudia" href="#">Kudia</a></div>
</div>
<div id="description">
<div id="top">description</div>
<div id="kazooki">kazooki</div>
<div id="UoD">Universe of Downhill</div>
<div id="kudia">kudia</div>
</div>
<script type="text/jscript">
function goToByScroll(id){
$("#description").animate({scrollTop: $("#"+id).offset().top},'slow');
}
$("#row1 > a").click(function(e) {
// Prevent a page reload when a link is pressed
e.preventDefault();
// Call the scroll function
goToByScroll($(this).attr("id"));
});
</script>
Last edited: