开发者

Jquery Mobile - How to use ScrollView...What do I have to include?

开发者 https://www.devze.com 2023-04-11 04:33 出处:网络
This is my code: <div data-role=\"content\" data-theme=\"b\"> <div data-scroll=\"y\"> <ul>

This is my code:

        <div data-role="content" data-theme="b">
            <div data-scroll="y">
                <ul>
                    <li data-role="button" data-icon="arrow-r" oncl开发者_StackOverflowick="redirectPage(1);">All Day and All of the Night-Kinks</li>
                    <li data-role="button" data-icon="arrow-r" onclick="redirectPage(2);">Sunshine of Your Love-Cream</li>

                </ul>
            </div>
        </div>

I have included all the files and still it wont work


You need to include the css file, and the jquery easing script.

Scripts must be included in this order:

  • jquery
  • jquery.mobile
  • jquery.easing
  • jquery.mobile.scrollview
  • scrollview

The css file gives you the scroll bars, jquery.easing gives the smooth animation (an impressive project by itself), jquery.mobile.scrollview does the heavy lifting, scrollview scrapes the page and adds enough markup for the scrollview to take over.

It is 'Experimental' for a reason. The feature is not officially supported, however I have found very few problems with it on mobile devices.

It is also worth noting that implementing proper fixed toolbars is expected to be released in version 1.1, so it won't be needed to have the separate scrolling scripts to handle scrolling only the content. If you want other kinds of scrolling, you will still need the extra stuff.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号