user796443
user796443

Reputation:

jquery: rotate items in loop

How would you make this slider navigation bar go in loop?

I made simple jquery that just increments margin, can you think of a way of easily looping this thing?

Right now if you click enough times it blank space will be visible...

Any help appreciated.

jsfiddle: http://jsfiddle.net/utKqe/2/

//other category page, navigate through cats
    $(document).ready(function() {

        $('#otherleftarrow').click(function() {
            $('#othermenu ul').animate({marginLeft: '-=100px'}, 200);
            return false; // prevent default click action from happening!
        });

        $('#otherrighttarrow').click(function() {
            $('#othermenu ul').animate({marginLeft: '+=100px'}, 200);
            return false;
        });

    });

Upvotes: 0

Views: 292

Answers (1)

daeq
daeq

Reputation: 1181

There is quite nice jQuery plugin for this task: jCarousel.

Circular carousel example.

You can easily use it for your purpose.

Upvotes: 1

Related Questions