I want to reference a js that can zoom in and out of pictures in html.
It is best to use two kinds of pictures, one big picture and one small picture.
I want to use the comment and picture sharing function of the mall
Is there a simpler one, I don’t quite understand
Generally, this kind of function requires a lot of functions, such as the animation effect of a large picture popping up when clicked, a mask layer, whether the picture needs to be turned into a controllable queue, etc. So when there are more functions, there will naturally be more codes. Generally, either Make it into a JQ extended object method plug-in, or implement it as a js constructor, ES6 class, etc.
If you need the simplest function of clicking a small picture to pop up a large picture - - here is the most original one. .
View the example directly: https://jsfiddle.net/v1sgnuhp/
Click area of thumbnail
Display area of large image
css
js
From "The Art of Javascript Dom Programming" with slight modifications. . . I remember reading this book when I first learned JS
http://photoswipe.com/ Isn’t this pretty good?