简体   繁体   English

轨道图像滑块插件为何不起作用?

[英]How come orbit image slider plugin isn't working?

I'm setting up orbit according to this guide and for some reason it is not working at all. 我正在按照此指南设置轨道,由于某种原因,它根本无法正常工作。 I'm sure its something incredibly simple being that there are only like 2 steps to follow, but I'm really not seeing it and could use a second set of eyes. 我敢肯定这非常简单,因为只有两个步骤可以执行,但是我真的看不到它,可以用另一双眼睛。 Let me know if you see what the issue is, thanks! 让我知道是否看到问题所在,谢谢!

<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/jquery.orbit.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="css/orbit.css">
<script type="text/javascript">
 $(window).load(function() {
     $('#featured').orbit();
 });
</script>
<div id="featured"> 
 <img src="1.jpg" alt="Overflow: Hidden No More" />
 <img src="2.jpg"  alt="HTML Captions" />
 <img src="3.jpg" alt="and more features" />
</div>

Check your paths to jQuery and orbit JS files are correct and loading. 检查您的jQuery和Orbit JS文件路径是否正确并正在加载。

Try using $(document).ready(); 尝试使用$(document).ready();

    <div id="featured"> 
     <img src="1.jpg" alt="Overflow: Hidden No More" />
     <img src="2.jpg"  alt="HTML Captions" />
     <img src="3.jpg" alt="and more features" />
    </div>

    <script type="text/javascript">
     $(document).ready(function() {
         $('#featured').orbit();
     });
    </script>

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

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