国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

jquery.gridrotator實現響應式圖片展示畫廊效果

2019-11-20 12:11:42
字體:
來源:轉載
供稿:網友

 jquery.gridrotator是一款非常實用的響應式圖片展示畫廊插件。這款圖片展示畫廊插件將圖片像網格一樣排列,然后隨機將某個格子中的圖片翻轉顯示另一張圖片。共有6種效果。

HTML結構:

HTML結構非常簡單。

<div id="ri-grid" class="ri-grid ri-grid-size-1 ri-shadow">  <ul>    <li><a href="#"><img src="images/medium/1.jpg" alt="Whatever works"/></a></li>    <li><a href="#"><img src="images/medium/2.jpg" alt="Anything else"/></a></li>    <!-- ... -->  </ul></div>

調用插件

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

注意別忘了引入jQuery和jquery.gridrotator.js文件。
可選參數

// number of rowsrows      : 4, // number of columns columns     : 10, // rows/columns for different screen widths// i.e. w768 is for screens smaller than 768 pixelsw1024      : {  rows  : 3,  columns : 8}, w768      : {  rows  : 3,  columns : 7}, w480      : {  rows  : 3,  columns : 5}, w320      : {  rows  : 2,  columns : 4}, w240      : {  rows  : 2,  columns : 3}, // step: number of items that are replaced at the same time// random || [some number]// note: for performance issues, the number should not be > options.maxStepstep      : 'random',maxStep     : 3, // prevent user to click the itemspreventClick  : true, // animation type// showHide || fadeInOut || slideLeft || // slideRight || slideTop || slideBottom || // rotateLeft || rotateRight || rotateTop || // rotateBottom || scale || rotate3d || // rotateLeftScale || rotateRightScale || // rotateTopScale || rotateBottomScale || randomanimType    : 'random', // animation speedanimSpeed    : 500, // animation easingsanimEasingOut  : 'linear',animEasingIn  : 'linear', // the item(s) will be replaced every 3 seconds// note: for performance issues, the time "can't" be < 300 msinterval    : 3000,// if false the animations will not start// use false if onhover is true for exampleslideshow    : true,// if true the items will switch when hoveredonhover   : false,// ids of elements that shouldn't changenochange    : []

當你定義網格大小的時候,你要注意的是不是所有的圖片都會在網格中立刻顯示。舉個例子,你有50張圖片,定義了4行5列,那么會有20張圖片在網格中顯示,其它30張用來做圖片翻轉切換。

以上所述就是本文的全部內容了,希望大家能夠喜歡。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 仙居县| 香格里拉县| 资阳市| 泰宁县| 嘉义市| 峡江县| 从化市| 泾阳县| 宜阳县| 萨嘎县| 礼泉县| 友谊县| 巩留县| 聂拉木县| 上蔡县| 个旧市| 玉溪市| 临邑县| 玉田县| 宁津县| 武宣县| 鄂托克前旗| 赤水市| 克什克腾旗| 浦北县| 子长县| 海南省| 滨州市| 潜山县| 辽阳市| 迁西县| 兖州市| 淄博市| 襄汾县| 平阴县| 新郑市| 南平市| 射洪县| 叙永县| 仁寿县| 林口县|