Rendy
Rendy

Reputation: 5698

Scroll only listview, not other div?

How can I set if user scroll on listview, the other div outside listview no need to be scrolled too? I can't get any reference to do this out there.

Upvotes: 2

Views: 3470

Answers (1)

ezanker
ezanker

Reputation: 24738

Put your list within a DIV container. Give the container a max-height and make it scrollable:

<div class="listCont">
    <ul data-role="listview" data-inset="true">
        <li>item</li>
        <li>item</li>
        ...
    </ul>
</div>

.listCont {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 250px;
}

DEMO

-webkit-overflow-scrolling: touch; is the trick to make it scrollable on webkit touch devices.

Upvotes: 5

Related Questions