jQuery - Continuously scroll div on hover

2019-09-16 11:31发布

问题:

I wish to build a shelf of content much like on Netflix where when you hover over arrows on either end the shelf scrolls at a continuous speed. Ideally, I would also like to make it so when you click the arrows it scrolls a chunk along, so you have the option to click like made to get through a shelf quickly.

This will be using lazy loading so you don't need to worry about repeating content, but obviously it won't have a set width (other then the outside container being 100% with overflow scroll.

Also, this needs to be actually scrollable, so it will work on tablets/phones.

I have no idea here to start so any directions would be great.

Thanks, Jake!

Image of netflix shelf.

回答1:

UPDATE: Check out the Smooth Div Scroll jQuery plugin. It slides continuously through the image, you can hover the mouse on the div and manually scroll back- and forward.

Original answer: I might be off with that, but check out these two plugins:

jQuery Coverflow plugin or the jQuery Imageflow plugin

I think the keyword you are looking for is "flow" and there are multiple flow plugins for jQuery. Hope this helps.

Best regards, Michael