2012-09-29 51 views

回答

1

您可以創建鏈接按鈕,在individual.html,像這樣:下面給你的鏈接:

<a data-role="button" rel="external" href="index.html#your_virtual_page">BUTTON</a> 

這裏是有什麼事情的工作示例成爲您的文件index.htmlindividual.html

-index.html

<html> 
    <head> 
     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile.structure-1.1.1.min.css" /> 
     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" /> 
     <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> 
     <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script> 
    </head> 

    <body> 
     <div id="home" data-role="page"> 
      <div data-role="content"> 
       HOME 
      </div> 
     </div> 

     <!-- THE VIRTUAL PAGE THAT WE WANT TO ACCESS FROM individual.html --> 
     <div id="p2" data-role="page"> 
      <div data-role="content"> 
       PAGE 2!!! 
      </div> 
     </div> 
    </body> 
</html> 

-individual.html

<html> 
    <head>  
     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile.structure-1.1.1.min.css" /> 
     <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" /> 
     <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> 
     <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>   
    </head> 

    <body> 
     <div id="home" data-role="page"> 
      <div data-role="content"> 
       <!-- YOUR LINK TO YOUR VIRTUAL PAGE IN index.html --> 
       <a data-role="button" rel="external" href="./index.html#p2">TO PAGE 2</a> 
      </div> 
     </div> 

     <div id="p1" data-role="page"> 
      <div data-role="content"> 
       P1 
      </div> 
     </div>  
    </body> 
</html> 

希望這有助於伴侶。

+0

非常感謝..... itz正在工作..幫助 –

+0

您的歡迎夥伴! ;) – Littm

相關問題