Jquery移动页面导航
Jquery mobile pages navigation
我正在尝试使用Phonegap和jQuery mobile开发一个移动应用程序。我遇到的问题是,当事件被触发时,页面不会改变。下面是页面和jQuery的代码:
<div id="deviceready" data-role="page">
<div data-role="header">Header</div>
<div role="main" class="ui-content">
<form>
<label for="username">User name:</label>
<input name="username" id="username" value="" type="text">
<label for="password">User name:</label>
<input name="password" id="password" value="" type="password">
<button id="submit-login" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-user">Login</button>
</form>
</div>
<div data-role="footer">Footer</div>
</div>
<div id="formResults" data-role="page">
<div data-role="header">Header</div>
<div>Hello from success</div>
<div data-role="footer">Footer</div>
</div>
<script type="text/javascript">
$('#submit-login').click(function() {
$(':mobile-pagecontainer').pagecontainer('change', '#formResults', {
reload: true
});
});
</script>
导航页与页之间不工作
我认为你的动作在你的形式被触发重新加载自己。看看这个演示http://jsfiddle.net/JuY9L/这里我修改了表单的代码,使它返回一个空操作。
HTML:<div id="deviceready" data-role="page">
<div data-role="header">Header</div>
<div role="main" class="ui-content">
<form action="javascript:void(0);">
<label for="username">User name:</label>
<input name="username" id="username" value="" type="text" />
<label for="password">User name:</label>
<input name="password" id="password" value="" type="password" />
<button id="submit-login" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-left ui-icon-user">Login</button>
</form>
</div>
<div data-role="footer">Footer</div>
</div>
<div id="formResults" data-role="page">
<div data-role="header">Header</div>
<div>Hello from success</div>
<div data-role="footer">Footer</div>
</div>
相关文章:
- 删除移动视图粘性js上的粘性导航栏
- 在下拉导航中将文本向左移动
- css,用于在移动视图中将引导导航栏更改为accordian
- 自动折叠移动设备上的OpenUI5侧边导航
- Bootstrap更改移动设备的导航栏高度
- 导航菜单不适合移动浏览器
- Angular UI&引导程序:点击链接时折叠移动导航栏
- 为什么我的导航按钮或按钮文本不会移动到中心
- 如何在页面之间导航后停止jquery移动中的重复数据
- 铬移动;导航.地理位置不起作用
- 移动导航菜单不起作用(HTML,CSS和JQuery)
- 显示移动窗口时引导导航栏中的 atach 搜索栏
- 折叠导航按钮不适用于twitter引导程序设计的移动设备
- Bootstrap 3.3-导航栏无法在移动设备上工作
- 我可以'我似乎没有得到我的网站'移动导航开始工作
- jQuery移动Ajax导航功能和CSS样式
- 移动徽标下方的主导航图标
- 使用jQuery移动ajax导航加载多页模板
- 如何仅在窗口宽度从桌面(>1024px)更改为移动(<1025px)导航时重新加载页面
- 实现画布外导航移动与桌面