dmitryproa/swipebox

此包的最新版本(1.4.4)没有可用的许可证信息。

一个可触摸的jQuery灯箱(来源:https://brutaldesign.github.io/swipebox/ )

维护者

详细信息

github.com/dmitryproa/swipebox

源代码

安装: 2

依赖: 0

建议者: 0

安全: 0

星级: 0

关注者: 0

分支: 667

语言:JavaScript

1.4.4 2024-08-15 10:28 UTC

This package is auto-updated.

Last update: 2024-09-15 10:41:46 UTC


README

ORIGIN: https://github.com/brutaldesign/swipebox 这个分支只是为了composer

Swipebox

一个可触摸的jQuery灯箱。

查看项目页面

Swipebox是什么?

Swipebox是一个用于桌面、移动和平板电脑的jQuery "灯箱"插件。

特性

  • 移动设备的手势滑动
  • 桌面的键盘导航
  • CSS过渡与jQuery回退
  • 支持UI图标的高分辨率显示
  • 简单的CSS自定义
  • 视频、图片和内联内容

兼容性

Chrome、Safari、Firefox、Opera、IE9+、IOS4+、Android、windows phone。

使用方法

JavaScript

在您的头部标签中包含jquery和swipebox脚本,或者在body关闭标签之前。

<script src="lib/jquery-3.5.2.js"></script>
<script src="src/js/jquery.swipebox.js"></script>

CSS

在您的头部标签中包含swipebox CSS样式。

<link rel="stylesheet" href="src/css/swipebox.css">

HTML

为您的链接使用特定的类,并使用title属性作为标题。

<a href="big/image.jpg" class="swipebox" title="My Caption">

启动插件

将"swipebox"类的行为绑定到每个链接。

$( '.swipebox' ).swipebox();

选项

useCSS : true, // false will force the use of jQuery for animations
initialIndexOnArray: 0, // which image index to init when a array is passed
removeBarsOnMobile : true, // false will show top navigation bar on mobile devices
hideCloseButtonOnMobile : false, // true will hide the close button on mobile devices
removeBarsOnMobile : true, // false will show bottom bar on mobile devices
hideBarsDelay : 3000, // delay before hiding bars on desktop
videoMaxWidth : 1140, // videos max width
beforeOpen: function(){} , // called before opening
afterOpen: null, // called after opening
afterClose: function(){}, // called after closing
afterMedia: function(){}, // called after media is loaded
loopAtEnd: false, // true will return to the first image after the last image is reached
autoplayVideos: false // true will autoplay Youtube and Vimeo videos
queryStringData: {} // plain object with custom query string arguments to pass/override for video URLs,
toggleClassOnLoad: '' // CSS class that can be toggled when the slide will be loaded (like 'hidden' of Bootstrap)
useSVG: true
nextSlide: function(){} // called on next slide, works for next button, arrow keys and touch navigation
prevSlide: function(){} // called on previous slide, works for previous button, arrow keys and touch navigation

拉取请求

我希望保持此插件尽可能简单。我不会合并添加下载按钮、社交点赞按钮、IE8兼容性等功能等额外功能的拉取请求。但是,请随意分叉项目并根据您的需求进行自定义。最需要的PR是用于错误修复。未来的改进将允许在可触摸设备上进行缩放。

如果您想提交拉取请求,请确保使用grunt整个项目(主要是jshintrc验证和压缩文件),并发送给我一个演示URL。另外,请注释您的代码。

感谢您的理解,并感谢大家的有益支持!