2012-09-29 52 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

相关问题