不要只是创建一个标记,我们要将一个onclick事件附加到缩略图并调用lightbox来显示大图。
Instead of just creating an tag, attach an onclick event to it and call the lightbox to show the large image.
在下面的示例中,我在页面中添加了一个缩略图,当用户单击它时便会在“lightbox”中显示出大图。
In the case of the example below, I have an image thumbnail on the page, and when users click it, they're shown a larger version in a "lightbox."
更进一步,您可能拥有一系列缩略图,并想为每个缩略图打开一个包含对应大图的 lightbox。
To take this even a step farther, you could have a gallery of thumbnails, and may want to open a lightbox with the relevant large image for each thumbnail.
应用推荐