Skip to content

Commit

Permalink
更新:优化灯箱显示效果
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuchunshu committed Dec 9, 2023
1 parent ab495e2 commit c40dc44
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Plugins/Topic/resources/assets/js/core.js

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions app/Plugins/Topic/resources/package/js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if (document.getElementById('topic-page')) {

// 如果父级标签不是A标签,则添加A标签
if ($(this).attr("lightbox")!=="false" && parentTagName !== "A") {
$(this).wrap("<a href='" + $(this).attr("src") + "' data-fancybox data-caption='" + $(this).attr("alt") + "'></a>");
$(this).wrap("<a href='" + $(this).attr("src") + "' data-fancybox=\"gallery\" data-caption='" + $(this).attr("alt") + "'></a>");
}

});
Expand All @@ -75,14 +75,24 @@ if (document.getElementById('topic-page')) {

// 如果父级标签不是A标签,则添加A标签
if ($(this).attr("lightbox")!=="false" && parentTagName !== "A") {
$(this).wrap("<a href='" + $(this).attr("src") + "' data-fancybox data-caption='" + $(this).attr("alt") + "'></a>");
$(this).wrap("<a href='" + $(this).attr("src") + "' data-fancybox=\"gallery\" data-caption='" + $(this).attr("alt") + "'></a>");
}

});

// 等待上面循环执行完毕
Fancybox.bind("[data-fancybox]", {
// Your custom options
contentClick: "toggleCover",
Thumbs: {
showOnStart: false,
},
Images: {
Panzoom: {
panMode: "mousemove",
mouseMoveFactor: 1.1,
mouseMoveFriction: 0.12,
},
}
});

}
Expand Down
2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"/plugins/Topic/js/tag.js": "/plugins/Topic/js/tag.js?id=1e874b0101d587c0a73e",
"/plugins/Topic/js/topic.js": "/plugins/Topic/js/topic.js?id=5e3cb57b4063e99612bb",
"/plugins/Topic/js/editor.js": "/plugins/Topic/js/editor.js?id=d41d8cd98f00b204e980",
"/plugins/Topic/js/core.js": "/plugins/Topic/js/core.js?id=700e0b2767dbd0f2b84a",
"/plugins/Topic/js/core.js": "/plugins/Topic/js/core.js?id=a29202489001310da0ea",
"/plugins/User/js/order.js": "/plugins/User/js/order.js?id=c00a6dabf17cd32a229c",
"/plugins/User/js/pm.js": "/plugins/User/js/pm.js?id=00970bdf6a4b6fefa9e5",
"/plugins/User/js/user.js": "/plugins/User/js/user.js?id=4f7e20e856fc2ab616dc",
Expand Down

0 comments on commit c40dc44

Please sign in to comment.