PhoneGap上的jQuery移动固定标头

时间:2013-08-20 14:07:34

标签: jquery-mobile scroll jquery-mobile-listview

我正在使用jQuery mobile在Phonegap上编写应用程序。 我在listview中有一个固定的标题和一个很长的列表:

<body onload="onBodyLoad()">
        <div data-role="page" data-theme="c" id="app">  
            <!-- Header -->
            <div data-role="header" data-position="fixed" data-theme="b">
                <h2>header</h2>
            </div>

            <!-- page conent -->
            <div data-role="content" data-theme="d">
                <ul id="list" data-role="listview">
                    <!-- the list is created dynamically -->
                </ul>
            </div> 
        </div> 
    </body>

标题将包含一些操作按钮 滚动时我想保持标题固定,我在不同的设备上有一些奇怪的行为。 如何解决固定位置问题?

1 个答案:

答案 0 :(得分:1)

我使用的是iscroll,请参阅http://cubiq.org/dropbox/iscroll4/examples/simple/,但我的工作正常......如果您不喜欢使用iscroll,请使用jquery mobile中的固定工具栏http://jquerymobile.com/demos/1.2.1/docs/toolbars/bars-fixed.html