-1

如果我只使用单个 data-role="page",这很好用,但是如果我添加更多页面,我的意思是使用多个 data-role="page" 它会停止工作。

<div id="studentpage" data-role="page">
<div data-role="header" data-theme="b">
<h1>Search inputs</h1>
<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse"   class="ui-btn-right jqm-home">Home</a>
</div><!-- /header -->
<div data-role="content">
<form action="#" method="get">
<p>The search input is displayed like this:</p>
<div data-role="fieldcontain">
<label for="search">Search Input:</label>
<input type="search" name="password" id="search" value="" />
</div>
<p>Themed variation:</p>
<div data-role="fieldcontain">
<label for="searchA">Search Input:</label>
<input type="search" name="searchA" id="searchA" value="" data-theme="a" />
</div></form>
</div><!-- /content -->
</div><!-- /page -->

这很好用,但如果我再添加一个具有页面角色的 div

<div id="otherpage" data-role="page">
My second page
</div>

<div id="studentpage" data-role="page">
<div data-role="header" data-theme="b">
<h1>Search inputs</h1>
<a href="../../" data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-right jqm-home">Home</a>
</div><!-- /header -->
<div data-role="content">
<form action="#" method="get">
<p>The search input is displayed like this:</p>
<div data-role="fieldcontain">
<label for="search">Search Input:</label>
<input type="search" name="password" id="search" value="" />
</div>

<p>Themed variation:</p>
<div data-role="fieldcontain">
<label for="searchA">Search Input:</label>
<input type="search" name="searchA" id="searchA" value="" data-theme="a" />
</div>

</form>
</div><!-- /content -->
</div><!-- /page -->

这似乎很奇怪,请帮助。

4

1 回答 1

0

我正在使用隐藏显示来切换页面,因此它无法正常工作,因此被 jquery 方法 $.mobile.changePage("#studentpage") 取代,现在可以完美运行

于 2012-07-11T19:05:35.557 回答