Pergunta

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?

Foi útil?

Solução

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();
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top