SlidesJS插件无法正常工作

时间:2015-06-26 13:11:50

标签: javascript jquery html

我正在尝试使用Slidesjs插件在我的网站上创建幻灯片,但由于某种原因它无法正常工作。

    <!--Javascript-->
  <script type="text/javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script>
  <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
  <script type="text/java" src="jquery.stellar.min.js"></script>

  <script src="jquery.slides.min.js"></script>

  <script>
    $(function(){
      $("#slides").slidesjs({
        width: 940,
        height: 528
          });
        });
  </script>

<!--Javascript-->

<div id="slides">
                    <img src="http://placehold.it/940x528">
                    <img src="http://placehold.it/940x528">
                    <img src="http://placehold.it/940x528">
                    <img src="http://placehold.it/940x528">
                    <img src="http://placehold.it/940x528">
                  </div>

1 个答案:

答案 0 :(得分:1)

尝试:

<!--Javascript-->
<script type="text/javascript" src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="jquery.stellar.min.js"></script>

<script type="text/javascript" src="jquery.slides.min.js"></script>

<script>
$(function(){
  $("#slides").slidesjs({
    width: 940,
    height: 528
      });
    });
</script>

<!--Javascript-->

<div id="slides">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
              </div>

或者:

<!--Javascript-->
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="jquery.stellar.min.js"></script>

<script type="text/javascript" src="jquery.slides.min.js"></script>

<script>
$(function(){
  $("#slides").slidesjs({
    width: 940,
    height: 528
      });
    });
</script>

<!--Javascript-->

<div id="slides">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
                <img src="http://placehold.it/940x528">
              </div>

甚至可以使用最新的脚本库,以便将来可以做更多的

在firefox中使用开发人员工具(我更喜欢那个,但你可以使用另一个)来查看脚本中的冲突,它真的会帮助你适应这样的事情