Disable image viewer for futured image and more #567
Answered
by
razonyang
iamgiannisx
asked this question in
Q&A
-
Hi, I would like to disable image viewer for
|
Beta Was this translation helpful? Give feedback.
Answered by
razonyang
Jun 20, 2022
Replies: 1 comment 3 replies
-
Hi, the theme provide a viewer options file, just create the The following code snippet ignores the featured images that have class const options = {
filter(img: HTMLImageElement) {
let valid = !img.classList.contains('post-featured-img');
if (!valid) {
img.setAttribute('data-viewer-invisible', 'true');
}
return valid
},
};
export default options; Available options can be found at https://github.com/fengyuanchen/viewerjs/blob/main/README.md#options.
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
razonyang
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, the theme provide a viewer options file, just create the
assets/viewer/js/options.ts
file to your site root.The following code snippet ignores the featured images that have class
post-featured-img
, change it as you need.Available options can be found at https://github.com/fengyuanchen/viewerjs/blob/main/README.md#options.