Galleriffic-jquery图片画廊插件

发布于,归属于jquery插件沙发还空着,抢! 共有822人围观    

galleriffic

插件网址:http://www.twospy.com/galleriffic/index.html

使用方法:

引入JQ库与插件js

  1. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
  2.     <script type="text/javascript" src="js/jquery.galleriffic.js"></script>

添加容器html

  1. <div id="controls"></div>
  2. <div id="loading"></div>
  3. <div id="slideshow"></div>
  4. <div id="caption"></div>
  5. <div id="thumbs">
  6.     ... 这里用来放图片清单...
  7. </div>

建立图片清单列表

  1. <ul class="thumbs noscript">
  2.     <li>
  3.         <a class="thumb" href="path/to/slide" title="your image title">
  4.             <img src="path/to/thumbnail" alt="your image title again for graceful degradation" />
  5.         </a>
  6.         <div class="caption">
  7.             (这里用来放标题、描述等信息)
  8.         </div>
  9.     </li>
  10.     ... (接下的就是类似上面的li代码,一个li元素包含一张图片)
  11. </ul>

初始化插件:

  1. var gallery = $('#gallery').galleriffic('#thumbs', {
  2.         delay:                  3000 // 动画播放间隔时间
  3.         numThumbs:              20 // 所要显示的图片数目
  4.         preloadAhead:           40 // 设置为-1时预加载所有图片
  5.         enableTopPager:         false,
  6.         enableBottomPager:      true,
  7.         imageContainerSel:      '', // 接下来的三个属性是作为容器的css名
  8.         controlsContainerSel:   '', // The CSS selector for the element within which the slideshow controls should be rendered
  9.         captionContainerSel:    '', // The CSS selector for the element within which the captions should be rendered
  10.         loadingContainerSel:    '', // The CSS selector for the element within which should be shown when an image is loading
  11.         renderSSControls:       true, // 是否显示播放与暂停按钮
  12.         renderNavControls:      true, // 是否显示前进后退按钮
  13.         playLinkText:           'Play',
  14.         pauseLinkText:          'Pause',
  15.         prevLinkText:           'Previous',
  16.         nextLinkText:           'Next',
  17.         nextPageLinkText:       'Next &rsaquo;',
  18.         prevPageLinkText:       '&lsaquo; Prev',
  19.         enableHistory:          false, // Specifies whether the url's hash and the browser's history cache should update when the current slideshow image changes
  20.         autoStart:              false, // 是否自动播放
  21.         onChange:               undefined, // 接下来是插件的回调函数
  22.         onTransitionOut:        undefined, // accepts a delegate like such: function(callback) { ... }
  23.         onTransitionIn:         undefined, // accepts a delegate like such: function() { ... }
  24.         onPageTransitionOut:    undefined, // accepts a delegate like such: function(callback) { ... }
  25.         onPageTransitionIn:     undefined  // accepts a delegate like such: function() { ... }
  26.     });
(如果您喜欢这篇教程,可以通过支付宝打赏我们1元哦,拜谢!)

跟作者说两句

:wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-? :) :( :!: 8-O 8)