0

必要: data-role="page"> を使用しているときに、同じページの既存の DIV タグから別の DIV を表示/置換するには

問題: 次のページの reg ボタンを表示する div に対して hide/show メソッドを使用している場合 (クリック) =>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 エミュレーター

誰かが答えを持っている場合は、投稿してください!さらに提案を行い、知識を深めたい場合。この投稿をご覧いただきありがとうございます。

編集:(私の古いコード)

  <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>

4

1 に答える 1

0

問題は、ほとんどの場合、js コードにあります。

jQuery show()/hide()display: none;.

これが実際の例です

于 2013-02-26T00:49:42.467 に答える