scrollview for jQuery mobile tollbars *not* to be

2019-03-06 04:36发布

问题:

I have been using scrollview (http://jquerymobile.com/test/experiments/scrollview/) successfully for an image gallery left/right swipe (which looks great) however the header/footer are always persistent and I cant work out looking at the code or looking online a way for these to be inline rather then fixed (like the default jQuery mobile setup).

Any ideas? Or have I missed something obvious?

Many thanks.

回答1:

Change <div data-role="header" data-position="fixed"> into <div data-role="header"> in your html and it should be enough.

[edit]

Ok, It's not enough.

Scrollview plugin scrolls the area of a HTML element that it's applied to, so to scroll the whole page instead of a div in the content, you would have to put data-scroll="true" attribute in the page div.

I hereby declare, that I didn't test if it is supported by the scrollview plugin. ;)