0

In my page i have a header and and a listview in the container area, when scrolling the first time the header is in its position, but after clicking in the content ,i scrolled the header is moving. I put data-position is fixed in the container tag. What will be the problem?

<div data-role="page">

            <div id="page1">

                <div data-theme="b" data-role="header" data-position="fixed">
                     <h2 id="doc_title">
                 </h2>
               </div>


                <div data-role="content" style="position: inherit; margin-top:1.8em" data-theme="d">    
                    <ul id="cat_hold" data-role="listview" data-divider-theme="b" data-inset="true" style.marginTop="1.5em">               
                    </ul>
              </div>


            </div>
4

2 回答 2

0

Try combining your top two <div> elements. The data-role="header" and data-role="content" should be direct descendants of your data-role="page" element.

<div data-role="page" id="page1">
    <div data-role="header" data-position="fixed">
    ...
    </div>
    <div data-role="content">    
    ...
    </div>
</div>          
于 2012-12-28T14:43:21.263 回答
0

Fixed Headers just work fine for iOS-Devices. Implement iScrollview to achieve a more stable performance. https://github.com/watusi/jquery-mobile-iscrollview

于 2012-12-28T23:28:29.940 回答