需要:使用 data-role="page"> 在同一页面上显示/替换现有 DIV 标记中的另一个 DIV
问题:使用隐藏/显示方法显示下一页 reg button(click)=>reg DIV content> 但 Reg DIV Content 仅显示 2 秒,然后应用程序退出并进入主模拟器中的菜单。
Code_STRUCTURE:(如下所述)
<div id="page" data-role="page">
<div id="header" data-role="header">
</div>
<div id="content" data-role="content">
<div id="log_in"> <!-- 1st content <div> -->
</div>
<!-- need to replace -->
<div id="reg"> <!-- 2nd content <div> -->
</div>
<!-- other <Div> with same procedure-->
</div> <!-- content END -->
<div id="footer" data-role="footer">
</div>
</div> <!-- page -->
// in J query call
// to show reg content then call
$('#log_in').hide(); // or also tried as $('#log_in').css('display','none');
$('#reg').show(); // or also tried as $('#reg').css('display','block');
平台 :Android 编译于:Eclipse Emulator
如果有人有答案,请留言!如果您愿意提供更多建议并且知识渊博。感谢您访问这篇文章!
编辑:(我的旧代码)
<div id="page" data-role="page">
<div id="header" data-role="header">
</div>
<div id="content" data-role="content">
<div id="log_in"> <!-- 1st content <div> -->
<form>
<input><!-- something goes here-->
<button id="login">Login</button>
<button id="reg">Register</button>
**</form>**
</div>
<!-- need to replace -->
<div id="reg"> <!-- 2nd content <div> -->
</div>
<!-- other <Div> with same procedure-->
</div> <!-- content END -->
<div id="footer" data-role="footer">
</div>
(更正的代码):
<div id="page" data-role="page">
<div id="header" data-role="header">
</div>
<div id="content" data-role="content">
<div id="log_in"> <!-- 1st content <div> -->
<form>
<input><!-- something goes here-->
**</form>**
<button id="login">Login</button>
<button id="reg">Register</button>
</div>
<!-- need to replace -->
<div id="reg"> <!-- 2nd content <div> -->
</div>
<!-- other <Div> with same procedure-->
</div> <!-- content END -->
<div id="footer" data-role="footer">
</div>