문제

I have a simple scrollable functionality that just scrolls images within a container.

On the right of this container I have a second scrollable that displays information about these images. If I click on the next link I want these two scrollables to scroll to the next element (the imagebox to the next image and the informationbox to the next infoblock).

How can I achieve this? Is it possible to link both scrollables to the same "prev" and "next" buttons?

도움이 되었습니까?

해결책

Sometimes it's more easy than it seems at first glance. It's enough, if both Scrollables are within the same mutual wrapper element. They both use the same prev and next buttons automatically. So clicking on one of them always scrolls all Scrollables within the same container.

So it's enough to init the Scrollables like:

$("#imagecontainer").scrollable();
 $("#textcontainer").scrollable();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top