2012-09-29 2 views
1

모바일 애플리케이션 index.html 및 individual.html에 2 개의 html 페이지가 있습니다. Index.html 페이지에는 많은 가상 페이지가 포함되어 있습니다. individual.html 페이지에 버튼이 있습니다. index.html의 가상 페이지에 링크하고 싶습니다.다른 html 페이지의 가상 페이지에 링크 : JQuery Mobile

가능합니까?

정확하게 수행 할 수있는 방법은 무엇입니까?

도와주세요

,

감사

답변

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 working..great help –

+0

환영 메이트! ;) – Littm

관련 문제