图片/图形

响应式图片展示画廊jQuery特效

阿里云


jquery.gridrotator 是一款非常实用的响应式图片展示画廊插件。这款图片展示画廊插件将图片像网格一样排列,然后随机将某个格子中的图片翻转显示另一张图片。共有 6 种效果。

HTML 结构:

HTML 结构非常简单。

也想出现在这里?联系我们
创客主机
  1. <div id="ri-grid" class="ri-grid ri-grid-size-1 ri-shadow">
  2.     <ul>
  3.         <li><a href="#"><img src="images/medium/1.jpg" alt="Whatever works"/></a></li>
  4.         <li><a href="#"><img src="images/medium/2.jpg" alt="Anything else"/></a></li>
  5.         <!-- ... -->
  6.     </ul>
  7. </div>

调用插件

  1. $(function() {         
  2.     $( '#ri-grid' ).gridrotator();
  3. });

注意别忘了引入 jQuery 和 jquery.gridrotator.js 文件。

可选参数

  1. // number of rows
  2. rows            : 4,
  3.  
  4. // number of columns 
  5. columns         : 10,
  6.  
  7. // rows/columns for different screen widths
  8. // i.e. w768 is for screens smaller than 768 pixels
  9. w1024           : {
  10.     rows    : 3,
  11.     columns : 8
  12. },
  13.  
  14. w768            : {
  15.     rows    : 3,
  16.     columns : 7
  17. },
  18.  
  19. w480            : {
  20.     rows    : 3,
  21.     columns : 5
  22. },
  23.  
  24. w320            : {
  25.     rows    : 2,
  26.     columns : 4
  27. },
  28.  
  29. w240            : {
  30.     rows    : 2,
  31.     columns : 3
  32. },
  33.  
  34. // step: number of items that are replaced at the same time
  35. // random || [some number]
  36. // note: for performance issues, the number should not be > options.maxStep
  37. step            : 'random',
  38. maxStep         : 3,
  39.  
  40. // prevent user to click the items
  41. preventClick    : true,
  42.  
  43. // animation type
  44. // showHide || fadeInOut || slideLeft || 
  45. // slideRight || slideTop || slideBottom || 
  46. // rotateLeft || rotateRight || rotateTop || 
  47. // rotateBottom || scale || rotate3d || 
  48. // rotateLeftScale || rotateRightScale || 
  49. // rotateTopScale || rotateBottomScale || random
  50. animType        : 'random',
  51.  
  52. // animation speed
  53. animSpeed       : 500,
  54.  
  55. // animation easings
  56. animEasingOut   : 'linear',
  57. animEasingIn    : 'linear',
  58.  
  59. // the item(s) will be replaced every 3 seconds
  60. // note: for performance issues, the time "can't" be < 300 ms
  61. interval        : 3000,
  62. // if false the animations will not start
  63. // use false if onhover is true for example
  64. slideshow       : true,
  65. // if true the items will switch when hovered
  66. onhover     : false,
  67. // ids of elements that shouldn't change
  68. nochange        : []

当你定义网格大小的时候,你要注意的是不是所有的图片都会在网格中立刻显示。举个例子,你有 50 张图片,定义了 4 行 5 列,那么会有 20 张图片在网格中显示,其它 30 张用来做图片翻转切换。

响应式图片展示画廊 jQuery 特效

已有 398 人购买
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!