Browse Source

improve fancybox toolbar for mobile

master
filesite 3 months ago
parent
commit
21facc9e87
  1. 33
      www/js/beauty.js

33
www/js/beauty.js

@ -86,22 +86,37 @@ if ($('#image_site').get(0)) {
}; };
// 图片浏览 // 图片浏览
Fancybox.bind('[data-fancybox]', { var fancyboxToolbar = {
Toolbar: { display: {
display: { left: ["infobar"],
left: ["infobar"], middle: [
middle: [
"zoomIn", "zoomIn",
"zoomOut", "zoomOut",
"toggle1to1", "toggle1to1",
"rotateCCW", "rotateCCW",
"rotateCW", "rotateCW",
"flipX", "flipX",
"flipY", "flipY"
], ],
right: ["slideshow", "fullscreen", "thumbs", "download", "close"], right: ["slideshow", "fullscreen", "thumbs", "download", "close"],
},
}, },
};
if ($(window).width() < 640) { //小屏幕只显示部分按钮
fancyboxToolbar = {
display: {
left: ["infobar"],
middle: [
"zoomIn",
"zoomOut",
"rotateCCW",
"rotateCW"
],
right: ["download", "close"]
}
};
}
Fancybox.bind('[data-fancybox]', {
Toolbar: fancyboxToolbar,
loop: true, loop: true,
smallBtn: false, smallBtn: false,
iframe: { iframe: {

Loading…
Cancel
Save