2011-07-29 2 views
0

内部ページが正しく表示されますが、ポップアップダイアログを表示した後にそのページに戻ったときにページが空白になります。jqueryモバイル内部ページの繰り返し表示

<!DOCTYPE html> 
<html> 
    <head> 
     <title>Test</title> 
     <meta name="viewport" content="width=device-width, initial-scale=1"/> 

     <script src="http://code.jquery.com/jquery-1.6.1.min.js"></script> 
     <link href="js/jquery.mobile-1.0b1.css" rel="stylesheet" type="text/css" /> 
     <script src="js/jquery.mobile-1.0b1.js" type="text/javascript"></script> 
     <script src="js/test.js" type="text/javascript"></script> 
    </head> 
<body> 

<div data-role="page" id="program"> 
    <div data-role="header" data-nobackbtn="true"> 
     <h1>Test Page</h1> 
    </div><!-- /header --> 
     <div data-role="content" data-theme="a" id="listChoices"> 
     <div data-role="controlgroup" id="possible"> 
     <a href="#" data-role="button" id="choice1" class="response">1</a> 
     <a href="#" data-role="button" id="choice2" class="response">2</a> 
     <a href="#" data-role="button" id="choice3" class="response">3</a> 
     <a href="#" data-role="button" id="choice4" class="response">4</a> 
     </div> 
    </div><!-- /content --> 
    <div data-role="footer" style="font-family: Arial, Helvetica, sans-serif; font-size: x-small; color: #FFFFFF"> 
     test (c) 2011 
    </div><!-- /footer --> 
</div><!-- /page --> 

<div data-role="page" id="popup"> 
    <div data-role="header" data-nobackbtn="true" data-theme="e"> 
     <h1>How did I do?</h1> 
    </div><!-- /header --> 
     <div data-role="content" data-theme="d"> 

    <label id="msg" style="margin-right:auto;margin-left:auto; text-align:center; font-family:@Arial Unicode MS; font-size:large"></label> 
    <div id="Div5" style="width:200px;margin-right:auto;margin-left:auto"><input id="btnReturn" type="button" value="Continue" /> </div> 

    </div><!-- /content --> 
    <div data-role="footer" style="font-family: Arial, Helvetica, sans-serif; font-size: x-small; color: #FFFFFF"> 
     Test (c) 2011 
    </div><!-- /footer --> 
</div><!-- /page --> 

</body> 
</html>  

var msg 
$(document).ready(function() 
{ 
    $("[class^='response']").click(function() 

    { 
     var t = this.id.replace('choice', ''); 
      $("#msg").html('You pressed number '+ t); 
      $.mobile.changePage("#popup", { transition: "flip" }); 
    }); 
    $('#btnReturn').click(function() 
    { 
     $("#popup").hide() 
     $.mobile.changePage("#program", { transition: "flip" }); 
    }); 
}); 

答えて

0

は、この行を取り除く:

$("#popup").hide(); 

あなたはポップアップを隠しているあなたはそれに戻って切り替えるときにdiv要素が隠されています。

http://jsfiddle.net/j6BGp/12/

関連する問題