首页新闻找找看学习计划

手机分页问题

0
悬赏园豆:10 [已解决问题] 解决于 2012-05-23 20:28

我从后台获取到的数据放在一个listView

我如何对这个页面进行分页呢??

秋风中恶之花的主页 秋风中恶之花 | 初学一级 | 园豆:74
提问于:2012-05-23 10:34
< >
分享
最佳答案
0

在footer中放两个按钮(链接)用来翻页,参数(第几页)放在地址中

收获园豆:10
artwl | 专家六级 |园豆:16526 | 2012-05-23 10:38

我想在我获取到的内容页里面翻页!!!而且我从后台取值是全部把值取到了,我想规定每个页面只显示几条!!

秋风中恶之花 | 园豆:74 (初学一级) | 2012-05-23 10:43

@秋风中恶之花: 这样的话你参考这里,这里就是先把第二页内容隐藏掉,点击时再显示的:http://jquerymobile.com/demos/1.1.0/docs/pages/multipage-template.html

artwl | 园豆:16526 (专家六级) | 2012-05-23 10:45

@artwl:我的html代码中只有 <div id="dataList"></div> 获取到的数据都会放在这个div里,我想知道的是我如何对这个div里面的数据进行分页。

秋风中恶之花 | 园豆:74 (初学一级) | 2012-05-23 12:07

@秋风中恶之花: 文档里不是写得很明白吗:

Multi-page template structure
A single HTML document can contain multiple 'pages' that are loaded together by stacking multiple divs with a data-role of "page". Each 'page' block needs a unique ID (id="foo") that will be used to link internally between 'pages' (href="#foo"). When a link is clicked, the framework will look for an internal 'page' with the ID and transition it into view.

Here is an example of a 2 "page" site built with two jQuery Mobile divs navigated by linking to an ID placed on each page wrapper. Note that the IDs on the page wrappers are only needed to support the internal page linking, and are optional if each page is a separate HTML document. Here is what two pages look inside the body element.


<body> 

<!-- Start of first page -->
<div data-role="page" id="foo">

    <div data-role="header">
        <h1>Foo</h1>
    </div><!-- /header -->

    <div data-role="content">    
        <p>I'm first in the source order so I'm shown as the page.</p>        
        <p>View internal page called <a href="#bar">bar</a></p>    
    </div><!-- /content -->

    <div data-role="footer">
        <h4>Page Footer</h4>
    </div><!-- /footer -->
</div><!-- /page -->


<!-- Start of second page -->
<div data-role="page" id="bar">

    <div data-role="header">
        <h1>Bar</h1>
    </div><!-- /header -->

    <div data-role="content">    
        <p>I'm the second in the source order so I'm hidden when the page loads. I'm just shown if a link that references my ID is beeing clicked.</p>        
        <p><a href="#foo">Back to foo</a></p>    
    </div><!-- /content -->

    <div data-role="footer">
        <h4>Page Footer</h4>
    </div><!-- /footer -->
</div><!-- /page -->
</body>

相当于定义两个锚点

artwl | 园豆:16526 (专家六级) | 2012-05-23 12:15

@artwl: 我获取到的数据会动态的放在<div id="dataList"></div>像里面嵌套的<p></p>它是自动生成的,并不是自己去定义的,多少条数据自然会自己增加的

秋风中恶之花 | 园豆:74 (初学一级) | 2012-05-23 15:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册