Viewer.js --- 图片浏览插件

2021-10-02 21:16

阅读:976

标签:viewer   hit   移动   order   update   The   ext   支持   omr   主要功能: 支持选项 支持方法 支持事件 支持触摸 支持移动 支持缩放 支持旋转 支持键盘 跨浏览器支持 作者githup地址:https://github.com/fengyuanchen/viewer 演示地址:http://fengyuanchen.github.io/viewer/ 基本使用方法:   1.引入文件   2.HTML代码   3.JS代码 $(‘#viewer‘).viewer();  其他相关:   如需配置放大前后图片不同,可在src属性中放入原图,data-original属性中放入希望见到的放大后的图。在JS中进行配置: $(‘#viewer‘).viewer({url:"data-original"});   如需通过动态修改data-original,来达到动态加载图片的效果,需保证在原图已展示完成的情况下,执行update代码: $(‘#viewer‘).viewer(‘update’);      其他配置可在演示中查看,其中也有回调函数和自定义方法,总体来说是挺好用的插件。   配置 名称类型默认值说明inline 布尔值 false 启用 inline 模式 button 布尔值 true 显示右上角关闭按钮(jQuery 版本无效) navbar 布尔值/整型 true 显示缩略图导航 title 布尔值/整型 true 显示当前图片的标题(现实 alt 属性及图片尺寸) toolbar 布尔值/整型 true 显示工具栏 tooltip 布尔值 true 显示缩放百分比 movable 布尔值 true 图片是否可移动 zoomable 布尔值 true 图片是否可缩放 rotatable 布尔值 true 图片是否可旋转 scalable 布尔值 true 图片是否可翻转 transition 布尔值 true 使用 CSS3 过度 fullscreen 布尔值 true 播放时是否全屏 keyboard 布尔值 true 是否支持键盘 interval 整型 5000 播放间隔,单位为毫秒 zoomRatio 浮点型 0.1 鼠标滚动时的缩放比例 minZoomRatio 浮点型 0.01 最小缩放比例 maxZoomRatio 数字 100 最大缩放比例 zIndex 数字 2015 设置图片查看器 modal 模式时的 z-index zIndexInline 数字 0 设置图片查看器 inline 模式时的 z-index url 字符串/函数 src 设置大图片的 url build 函数 null 回调函数,具体查看演示 built 函数 null 回调函数,具体查看演示 show 函数 null 回调函数,具体查看演示 shown 函数 null 回调函数,具体查看演示 hide 函数 null 回调函数,具体查看演示 hidden 函数 null 回调函数,具体查看演示 view 函数 null 回调函数,具体查看演示 viewed 函数 null 回调函数,具体查看演示 Viewer.js --- 图片浏览插件标签:viewer   hit   移动   order   update   The   ext   支持   omr   原文地址:https://www.cnblogs.com/Icebang/p/9986588.html


评论


亲,登录后才可以留言!