click li, go to next li

Posted by steve on Stack Overflow See other posts from Stack Overflow or by steve
Published on 2010-05-14T07:40:38Z Indexed on 2010/05/14 7:44 UTC
Read the original article Hit count: 317

Filed under:
|

Can't find a simple solution to this, I know it's easy and I've tried a few things but I can't quite get it to work. I'm currently working with a sidescrolling site and I want every time you click an image (contained in an li) it scrolls to the next li. I have jQuery plugin localscroll so it smoothly goes from one to the next, and that's working. I need to now write a code that triggers jQuery to utilize the localscroll function and go to the next li. Right now I have this, but I know it's not right:

$(document).ready(function () {
    var gallery = $('.wrapper ul li')

    $(gallery).click(function() {
     $.localscroll().next(li);
    });
});

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about lists