简体   繁体   English

我的基础轨道图像滑块在 Codepen 中工作,但在 Plunker 中无效

[英]My foundation orbit image slider is working in Codepen but not in Plunker

My Orbit image slider is working as expected in Codepen.io ,我的轨道图像滑块在Codepen.io 中按预期工作,

<ul class="slider" data-orbit>
  <li>
    <img src="http://foundation.zurb.com/docs/assets/img/examples/satelite-orbit.jpg" alt="" />
    <div class="orbit-caption">insert the image caption here</div>
  </li>
  <li>
    <img src="http://foundation.zurb.com/docs/assets/img/examples/andromeda-orbit.jpg" alt="" />
    <div class="orbit-caption">insert the image caption here</div>
  </li>
  <li>
    <img src="http://foundation.zurb.com/docs/assets/img/examples/launch-orbit.jpg" alt="" />
    <div class="orbit-caption">insert the image caption here</div>
  </li>
</ul>

and

$(document).foundation();

but the very same code is not working in Plunker .但同样的代码在Plunker不起作用

So strange.这么奇怪。 Any help?有什么帮助吗? Thanks.谢谢。

You have not referenced your script.js in Plunkr.您尚未在 Plunkr 中引用您的script.js

In Codepen, the JS is added inline with the demo.在 Codepen 中,JS 被添加到演示中。 But in Plunkr, you need to reference the JavaScript file in your HTML code or you can add inline within <script>$(document).foundation();</script> before </body>但是在 Plunkr 中,你需要在你的 HTML 代码中引用 JavaScript 文件,或者你可以在<script>$(document).foundation();</script>之前的</body>添加内联

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/foundation.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/foundation/foundation.orbit.min.js"></script>
<script src="script.js"></script> <!-- Add --> 

Updated Plunkr.co 更新 Plunkr.co

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM