2013-05-20 128 views
0

我正在与Jquery Mobile平台合作开发移动网站。我必须使用面板。我能够制作一个工作面板http://jsfiddle.net/VQmsw/,但是当我将此代码嵌入到我的实际文件中时,它给出了一些页面加载问题。Jquery Mobile Panel:页面无法加载

<head> 
    <title>Panels | Jquery Mobile</title> 
    <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0-rc.1/jquery.mobile-1.3.0-rc.1.min.css" /> 
    <script src="http://code.jquery.com/mobile/1.3.0-rc.1/jquery.mobile-1.3.0-rc.1.min.js"></script> 
</head> 

<body> 
    <!-- @ Page=menu --> 
    <div data-role="page" id="menu"> 
     <div data-role="panel" id="myPanel" class="main_nav" data-display="push" data-dismissible="true" data-theme="a"> 
      <div class="nav_profile"> 
       <div class="nav_name"> 
        <h3>user</h3> 
        <p>2 active threads</p> 
       </div> 
       <!--/nav_name--> 
      </div> 
      <!--/nav_profile--> 
     </div> 
     <!-- /panel --> 
     <div data-role="header" class="ui-header ui-bar-c" data-fullscreen="true" data-position="fixed" data-tap-toggle="false"> 
      <a href="#myPanel" data-icon="home" data-iconpos="notext" data-theme="c"></a> 
      <h1 class="ui-title" role="heading" aria-level="1">Events</h1> 
      <a href="#myPanel" data-icon="menu" data-iconpos="notext" data-theme="c"></a> 
     </div> 
     <div data-role="content"></div> 
    </div> 
    <!--/menu--> 
</body> 

http://jsfiddle.net/57Mfu/。我知道在小提琴中你需要提供外部资源,但是相同的代码也不能正常工作。

任何建议??

+0

因为在这个小提琴中,您正在加载jQuery和jQuery Mobile两次。 http://jsfiddle.net/57Mfu/。检查**外部资源**左侧的面板,删除它们以及''中的那些,它将工作得很好。 http://jsfiddle.net/Palestinian/ytk6s/ – Omar

回答

1

使用jQuery 1.9.1和jQuery-Mobile 1.3.1的最新稳定版本。

<head> 
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3. 1.min.css" /> 
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> 
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script> 
</head> 
0

你应该使用jQuery 1.9.1,而不是2.0试试这个。我之前遇到类似的问题 - 它在jsfiddle上工作,但现在在我的代码中 - 然后我使用了jquery和jquery-mobile的所有正确版本,并且它像一个魅力一样工作。