支持触屏的jQuery响应式幻灯片展示插件Image Lightbox

ImageLightbox是一款轻量级的jQuery幻灯片插件,支持触摸操作和响应式设计,适用于各种屏幕尺寸。该插件仅4KB大小,具备良好的可扩展性和配置选项,并能预加载图片,利用CSS3实现平滑过渡。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

支持触屏的jQuery响应式幻灯片展示插件Image Lightbox,非常不错的幻灯片图片展示插件,
支持移动端图片的展示,图片自适应任意大小的屏幕,轻量级插件只有4k,有很好插件可扩
展性和配置,兼容jQuery 1.x和2.x,提前预加载图片,使用了CSS3的转换和过渡,如果浏览器
不支持CSS3会自动切换left right 模式。

使用方法:
1.加载jQuery.js和imagelightbox.js
1 <script src="jquery.js"></script>
2 <script src="imagelightbox.js"></script>

2.加载CSS
1 #imagelightbox
2 {
3     positionfixed;
4     z-index9999;
5 }

3.HTML内容
1 <img src="picture.jpg" id="imagelightbox" />
4.函数调用
1 <script>
2     $( function()
3     {
4         $( '#imagelightbox' ).imageLightbox();
5     });
6 </script>
详细参数调用配置
01 $('#imagelightbox').imageLightbox(
02 {
03     selector:       'id="imagelightbox"',   // string;
04     allowedTypes:   'png|jpg|jpeg|gif',     // string;
05     animationSpeed: 250,                    // integer;
06     preloadNext:    true,                   // bool;            silently preload the next image
07     enableKeyboard: true,                   // bool;            enable keyboard shortcuts (arrows Left/Right and Esc)
08     quitOnEnd:      false,                  // bool;            quit after viewing the last image
09     quitOnImgClick: false,                  // bool;            quit when the viewed image is clicked
10     quitOnDocClick: true,                   // bool;            quit when anything but the viewed image is clicked
11     onStart:        false,                  // function/bool;   calls function when the lightbox starts
12     onEnd:          false,                  // function/bool;   calls function when the lightbox quits
13     onLoadStart:    false,                  // function/bool;   calls function when the image load begins
14     onLoadEnd:      false                   // function/bool;   calls function when the image finishes loading
15 });
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值