Tomasz Tomasz - 1 year ago 188
HTML Question

Open fancybox onclick using jQuery

I have structure like this:

<div class="grid-item" style="position: absolute; left: 0px; top: 0px;">
<a class="fancybox-button" rel="fancybox-button" href="">
<img src=",q_auto:good,w_900/v1/tiltkomp/gallery/bodnar.jpg" alt="bodnar" data-tag="shop all ">
<div class="img-bg">
<i class="fa fa-search-plus" aria-hidden="true"></i>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. .</p>

how to open fancybox after click on
<i class="...>

Answer Source

Simple way (if you use jQuery): You can make a click on "fancybox-button" (it will open fancybox), when you will click on i element. For example:

$("i.fa-search-plus").click( function() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download