I am using Jquery .animate to scroll a UL up and down so that you can see all the elements, how would i make IF ELSE statement that said.
IF the FIRST LI item in the UL is at the top, dont scroll anymore, and IF the last item is at the bottom of the visible portion of the screen dont scroll any more down, else scroll 510 px.
Right now my code looks like this:
$('#down').click(function() {
$(".project_thumbs").stop().animate({"top": "-=510px"});
});
$('#up').click(function() {
if (".project_thumbs" (top = 0)){
$(".project_thumbs").stop().animate({top:0});
}
else{
$(".project_thumbs").stop().animate({"top": "+=510px"});
}