I'm dh, a fullStack developer.
- Vue3 Baidu Map Gl Components Libary
- Ts Config Helper
- Img Previewer
- Vite Plugin Spa Loading
- Vite Plugin Env Parse
- Vite Plugin Base64 Import
- Vite Plugin Super Icon
A light wight javascript image viewing plugin with silky preview animation and dependence free
Home Page: https://yue1123.github.io/img-previewer/demo/index.es.html
License: MIT License
Hey!
I have been using this awesome package to work with my project but I have hit a issue which I think would be a great addition to your package.
When passing in paramaters to the ImgPreviewer()
it only allows for "selector" right now. I think being able to pass in HTMLElement
would make things much easier when dealing with logic around initalising the lightboxes.
My use case:
const lightboxes = $(".lightbox");
if (lightboxes.length > 0) {
lightboxes.each((index, lightbox) => {
new ImgPreviewer(lightbox, {
fillRatio: 0.7,
imageZoom: {
step: 1,
},
style: {
modalOpacity: 0.8,
headerOpacity: 1,
zIndex: 1,
},
bubblingLevel: 1,
onClose: () => {},
triggerEvent: "click",
onShow: () => null,
});
});
}
Let me know if this sounds like something you might be interested in!
Demo Site: [DELETED]
There are five images on the demo site, the first two images work well, but the last three images aren't be animated as wished when closing the preview layer.
if you want the source code for debugging, I would be pleased to send it to you by email.
last but not least, thanks for your great works on this awesome project.
Is it possible to show full preview image from the data attribute?
<img src="image.jpg" data-preview="image-large.jpg" alt="my-image">
I want to have some hidden images and then show previewer programatically. so can we have a function like previewer.show(1)
to show index one image?
now it has some issues like getting width: 0
and height: 0
sometimes, wouldn't want click to tirgger preview, like use listen click event to do other things
Hey! Came across this project today when on the lookout for an image lightbox that suits my needs.
The issue I ended up having is that it relies on images being loaded on the page at preview size i.e. at a larger size than they need to be in the context of the page layout, which is an obvious downnside re: performance.
Perhaps this can be solved with an enhancement that leverages a larger image path in a data attribute, or similar (this seems to be the way other libs handle it, at least).
When the thumbnail is clicked, Safari only shows a small portion of the image
I tried it and works good enough.
issue. There are 12 images in gallery, but it somehow counts images as 16 and loads even the logo in litebox. How can I avoid loading other images from the same page ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.