需要帮助设置一个jQuery插件“SpriteSpin”

时间:2015-06-16 07:14:30

标签: javascript jquery

这是插件页面: http://spritespin.ginie.eu/howto.html

这是我的网站: http://chronox.netai.net/

向下滚动到最底层以查看问题。

我希望该插件位于最后一部分(带箭头的滑块和'360 *'。

我按照说明操作。但显然它没有出现。有人可以看看代码,看看它是否正确?

  <script type="text/javascript">
  $(".threesixty-gold").spritespin({
  // path to the source images.
  source: [
  "assets/img/threesixty/gold/gold0000.jpg",
  "assets/img/threesixty/gold/gold0001.jpg",
  "assets/img/threesixty/gold/gold0002.jpg",
  "assets/img/threesixty/gold/gold0003.jpg",
  "assets/img/threesixty/gold/gold0004.jpg",
  "assets/img/threesixty/gold/gold0005.jpg",
  "assets/img/threesixty/gold/gold0006.jpg",
  "assets/img/threesixty/gold/gold0007.jpg",
  "assets/img/threesixty/gold/gold0008.jpg",
  "assets/img/threesixty/gold/gold0009.jpg",
  "assets/img/threesixty/gold/gold0010.jpg",
  "assets/img/threesixty/gold/gold0011.jpg",
  "assets/img/threesixty/gold/gold0012.jpg",
  "assets/img/threesixty/gold/gold0012.jpg",
  "assets/img/threesixty/gold/gold0013.jpg",
  "assets/img/threesixty/gold/gold0014.jpg",
  "assets/img/threesixty/gold/gold0015.jpg",
  "assets/img/threesixty/gold/gold0016.jpg",
  "assets/img/threesixty/gold/gold0017.jpg",
  "assets/img/threesixty/gold/gold0018.jpg",
  "assets/img/threesixty/gold/gold0019.jpg",
  "assets/img/threesixty/gold/gold0020.jpg",



  ],
  width   : 1900,  // width in pixels of the window/frame
  height  : 930,  // height in pixels of the window/frame
});

</script>

2 个答案:

答案 0 :(得分:2)

您需要将代码放在$( document ).ready(function() {});
中 的更新
您缺少spritespin.js参考。
<script src='spritespin.js' type='text/javascrip' />

答案 1 :(得分:0)

你需要在你的html中包含sprite js。你可以在jquery之后插入它。

<script src='jquery-1.4.2.js' type='text/javascript' />
<script src='spritespin.js' type='text/javascrip' />