基础选项卡不起作用

时间:2016-11-02 10:32:09

标签: javascript jquery zurb-foundation

我想使用jquery图像注释插件和多个图像的基础选项卡。注释事物对于第一个图像工作正常,但我无法切换到其他选项卡。我有jquery也没有冲突解决插件冲突问题但没有任何工作。这是我的代码

<head>
 <meta charset="utf-8" />
 <meta http-equiv="x-ua-compatible" content="ie=edge">
 <meta name="viewport" content="width=device-width, initial-scale=1.0"  />
 <title>Tabs</title>
 <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">

 <script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
 <link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
 <script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<link type="text/css" rel="stylesheet" href="https://annotorious.github.io/latest/annotorious.css" />
<script type="text/javascript" src="https://annotorious.github.io/latest/annotorious.min.js"></script>
</head>
<body>

<h2>Tabs Example</h2>
<ul class="tabs" data-tabs id="tabs_example">
<li class="tabs-title is-active"><a href="#tab1">Player 1</a></li>
<li class="tabs-title"><a href="#tab2">Player 2</a></li>
<li class="tabs-title"><a href="#tab3">Player 3</a></li>
<li class="tabs-title"><a href="#tab4">Player 4</a></li>
<li class="tabs-title"><a href="#tab5">Player 5</a></li>
</ul>

<div class="tabs-content" data-tabs-content="tabs_example">
<div class="tabs-panel is-active" id="tab1">
 <img id="myImage" class="annotatable" src="pic1.jpg" style="border: 30px solid #ccc; padding:20px;" width="30%" height="30%" /></div>
<div class="tabs-panel" id="tab2">
  <img id="myImage1" class="annotatable" src="pic2.jpg" style="border: 30px solid #ccc; padding:20px;" width="30%" height="30%" />
</div>
<div class="tabs-panel" id="tab3">
<p>Third Player</p>
<p>Shane Warne</p>
</div>
<div class="tabs-panel" id="tab4">
<p>Fourth Player</p>
<p>Shaun Pollock</p>
</div>
<div class="tabs-panel" id="tab5">
<p>Five Player</p>
<p>Adam Gilchrist</p>
</div>
</div>
<script>
$(document).ready(function() {
  $(document).foundation();
 })
</script>
<script>
 jQuery.noConflict();
 jQuery(function() {
  jQuery("#tabs-1").tabs({
    activate: function(event, ui) {
      jQuery('img.annotatable', ui.newPanel).each(function() {
        anno.makeAnnotatable(this);
      });
    }
   });
  });
  </script>

 </body>
 </html>        

请帮帮我。

1 个答案:

答案 0 :(得分:0)

你需要重新组织你的脚本 - 首先是css然后是js(首先是js get jquery,jquery UI,基础) - 这应该可以工作

<link href="https://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/css/foundation.css">
<link type="text/css" rel="stylesheet" href="https://annotorious.github.io/latest/annotorious.css" />

<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.0.1/js/foundation.min.js"></script>
<script type="text/javascript" src="https://annotorious.github.io/latest/annotorious.min.js"></script>