Lightbox/弹窗

flashy - 弹出层Lightbox相册插件

阿里云


Flashy.js 是一款响应式 jQuery Lightbox 和弹出层插件。该 jQuery Lightbox 和弹出层插件支持图片,内联内容,iframes,以及 vimeo 和 youtube 视频,功能非常强大。 它的特点还有:

支持项目计数

也想出现在这里?联系我们
创客主机

支持移动设备的 swipe 事件

支持预加载动画

支持键盘导航,和 ESC 键退出

支持视频自动播放

支持无限循环

使用方法:

在页面中引入 flashy.min.css 和 jquery 以及 jquery.flashy.min.js 文件。

  1. <link rel="stylesheet" href="css/flashy.min.css">
  2. <script src="jquery.min.js"></script>
  3. <script src="jquery.flashy.min.js"></script>

如果你需要添加更加炫酷的切换效果,可以引入 effect.css 文件。

  1. <link rel="stylesheet" href="css/effect.css">

HTML 结构:

然后在页面中创建一组需要展示的内容,结构如下:

  1. <a class="demo" href="image-big.jpg"><img src="image-small.jpg" alt="image alt"/></a>
  2. <a class="demo" data-flashy-type="video" href="https://vimeo.com/271516323">Vimeo</a>
  3. <a class="demo" data-flashy-type="video" href="https://youtu.be/dzNvk80XY9s">YouTube</a>
  4. <a class="demo" data-flashy-type="iframe" href="https://example.com/">iFrame</a>
  5. <a class="demo" data-flashy-type="inline" href="#inline">Inline</a>
  6. <div id="inline" style="display:none">
  7.   <div class="inline">
  8.    <!--内联内容-->
  9.   </div>
  10. </div>

初始化插件:

在页面 DOM 元素加载完毕之后,通过下面 flashy()方法来初始化该插件。

  1. $(document).ready(function(){
  2.   $('.demo').flashy(); 
  3. });

或者在初始化是传入配置参数:

  1. $('.demo').flashy({
  2.  
  3.   // Applied when a new item is shown
  4.   showClass: 'fx-fadeIn',
  5.  
  6.   // Applied when a new item is hidden
  7.   hideClass: 'fx-fadeOut'
  8.  
  9.   // Applied when a new item is shown on prev event
  10.   prevShowClass: 'fx-bounceInLeft',
  11.  
  12.   // Applied when a new item is shown on next event
  13.   nextShowClass: 'fx-bounceInRight',
  14.  
  15.   // Applied when the current item is hidden on prev event
  16.   prevHideClass: 'fx-bounceOutRight',
  17.  
  18.   // Applied when the current item is hidden on next event
  19.   nextHideClass: 'fx-bounceOutLeft'
  20.  
  21. });

配置参数:

Flashy.js 插件可用的配置参数有:

  1. $('.mixed').flashy({
  2.  
  3.   // image, inline, ajax, iframe, video
  4.   type: 'image',
  5.  
  6.   // show title
  7.   title: true,
  8.  
  9.   // can be any CSS valid unit - px, %, and etc
  10.   width: null,
  11.   height: null,
  12.  
  13.   // enable/disable gallery mode
  14.   gallery: true, 
  15.  
  16.   // enable/disable infinite loop
  17.   galleryLoop: true, 
  18.  
  19.   // show item counter
  20.   galleryCounter: true, 
  21.  
  22.   // show prev and next navigation controls
  23.   galleryPrevNext: true, 
  24.  
  25.   // message used in the item counter. If empty, no counter will be displayed
  26.   galleryCounterMessage: '[index] / [total]', 
  27.  
  28.   // enable/disable swipe on desktop
  29.   gallerySwipeDesktop: true, 
  30.  
  31.   // enable/disable swipe on mobile devices
  32.   gallerySwipeMobile: true, 
  33.  
  34.   // set swipe threshold in px
  35.   gallerySwipeThreshold: 100, 
  36.  
  37.   // enable/disable keyboard navigation with arrows and close with ESC
  38.   keyboard: true, 
  39.  
  40.   // close lightbox via the close button or overlay click
  41.   overlayClose: false, 
  42.  
  43.   // additional css classes for customization
  44.   themeClass: null, 
  45.  
  46.   // enable/Disable video autoplay
  47.   videoAutoPlay: false, 
  48.  
  49.   // error message displayed when a content fails to load
  50.   loadError: 'Sorry, an error occured while loading the content...'
  51.  
  52. });

Flashy.js 响应式 jQuery Lightbox 和弹出层插件的 github 地址为:https://github.com/avirtum/flashy

flashy - 弹出层 Lightbox 相册插件

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

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

发表回复

热销模板

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

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