在footer中放两个按钮(链接)用来翻页,参数(第几页)放在地址中
我想在我获取到的内容页里面翻页!!!而且我从后台取值是全部把值取到了,我想规定每个页面只显示几条!!
@秋风中恶之花: 这样的话你参考这里,这里就是先把第二页内容隐藏掉,点击时再显示的:http://jquerymobile.com/demos/1.1.0/docs/pages/multipage-template.html
@artwl:我的html代码中只有 <div id="dataList"></div> 获取到的数据都会放在这个div里,我想知道的是我如何对这个div里面的数据进行分页。
@秋风中恶之花: 文档里不是写得很明白吗:
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: 我获取到的数据会动态的放在<div id="dataList"></div>像里面嵌套的<p></p>它是自动生成的,并不是自己去定义的,多少条数据自然会自己增加的