Looking to create a vertical menu with a fixed height that smoothly slides up and down when the arrow buttons are clicked.
I'm struggling to figure out how to properly use offsets to determine where to navigate to. Right now, I am using the relative offset from the next list item and navigating there, but it's not functioning as intended. It seems incorrect. I believe I need to check if the bottom of the unordered list is visible in the div. If so, the downward arrow should no longer move. But how can I check for this?
//get position of next element
var offsetNextLi = jQuery($nextElement).position();
$liScrolledto = $nextElement;
jQuery("ul#inline_navigation").animate({
scrollTop: offsetNextLi.top
}, 500);
Here is my fiddle: