user1784025 user1784025 - 9 months ago 38
jQuery Question

Scrolling through multiple DIV elements

For example let's say that I have a div element with

width and
height. Inside that div I have 6 div elements floated left, with
enabled. What I want to achieve is, that user can scroll through loop of these divs (so that last div element is followed by first - infinite loop).

Any idea how to approach?

enter image description here


You can use jQuery insertAfter and insertBefore functions

     var last = $('#parent').find('div').last();

     var first= $('#parent').find('div').first();

Here is the DEMO