2012-02-25 10 views
2

最新のjQueryモバイル1.0.1を使用しています。最初のページからの移行後にロードする2番目のページでdata-role =スライダを使用しています。このデータロールスライダは2番目のページでは動作しません。そのページを単独で実行すると動作しますが、最初のページから移行した後は読み込まれません。私もデバッグをチェックして、javascriptエラーはありません。どんな助けもありがとう。jQueryモバイルデータロールスライダが動作しません

+0

2ページ目にdata-role = "page"を使用していますか?最初のページコードを投稿できますか? – DG3

答えて

0

以下のコードを探します。それは私のためにうまく動作します。

<!DOCTYPE html> 
<html class="ui-mobile-rendering"> 

<head> 
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <title>Single page template</title> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" /> 
    <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.js"></script> 
</head> 


<body> 

<div data-role="page" id="one"> 

    <div data-role="header"> 
     <h1>Single page</h1> 
    </div><!-- /header --> 

    <div data-role="content"> 
     <p>This is a single page boilerplate template that you can copy to build you first jQuery Mobile page. Each link or form from here will pull a new page in via Ajax to support the animated page transitions.</p>  
     <p>Just view the source and copy the code to get started. All the CSS and JS is linked to the jQuery CDN versions so this is super easy to set up. Remember to include a meta viewport tag in the head to set the zoom level.</p> 

     <p>This template is standard HTML document with a single "page" container inside, unlike a <a href="multipage-template.html" data-ajax="false">multi-page template</a> that has multiple pages within it. We strongly recommend building your site or app as a series of separate pages like this because it's cleaner, more lightweight and works better without JavaScript.</p> 
       <p><a href="#two" data-role="button">Show page "two"</a></p>  
     </div><!-- /content --> 

    <div data-role="footer"> 
     <h4>Footer content</h4> 
    </div><!-- /footer --> 

</div><!-- /page --> 

<!-- Start of second page: #two --> 
<div data-role="page" id="two" data-theme="a" data-transition="slider"> 

    <div data-role="header"> 
     <h1>Two</h1> 

    </div><!-- /header --> 

    <div data-role="content" data-theme="a"> 
       <label for="flip-a">Select slider:</label> 
       <select name="slider" id="flip-a" data-role="slider"> 
         <option value="off">Off</option> 
         <option value="on">On</option> 
       </select> 
     <h2>Two</h2> 
     <p>I have an id of "two" on my page container. I'm the second page container in this multi-page template.</p> 
     <p>Notice that the theme is different for this page because we've added a few <code>data-theme</code> swatch assigments here to show off how flexible it is. You can add any content or widget to these pages, but we're keeping these simple.</p> 
     <p><a href="#one" data-direction="reverse" data-role="button" data-theme="b">Back to page "one"</a></p> 

    </div><!-- /content --> 


    <div data-role="footer"> 
     <h4>Page Footer</h4> 
    </div><!-- /footer --> 
</div><!-- /page two --> 
</body> 
</html> 
+0

それはまだ私のために働かない。 – user1232072

+0

あなたのコードを投稿することができれば助かります。 – DG3

関連する問題