简体   繁体   中英

Open lightbox when click on link

I am looking for solution to open lightbox ( images ) when click on the link.

Example:

<a href="">View Gallery</a>

Here is my working image code with lightbox within foreach loop

echo '<a href="'.$media_url.$image_name.'" rel="lightbox['.$pid.']" title="Post: '.$pid.' |  '.$ptitle.' | Image: '.$image_name.' | by: '.$m_uname.' " ><img src="'.$thumb_path.$image_name.'" alt="'.$media->image_name.'" width="56" class="rm-thumbs-list" /></a>';

I have foreach loop and above code working fine with no issues. It is opening images in lightbox when the user clicks on the thumbnail. However now I have changed my mind. I am going to remove thumbnails and will add only one simple link when the user clicks on View Gallery I want to open lightbox with all the images

您只需要添加href页面, gallery.html下面就是存储所有图像的页面。

<a href="gallery.html" rel="lightbox">View Gallery</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM