JSFiddle - React, Tailwind, and code Playground

by Julian

HTML

<link rel="stylesheet" href="//yandex.st/jquery/fancybox/1.3.4/jquery.fancybox.css">
<script src="//yandex.st/jquery/fancybox/1.3.4/jquery.fancybox.min.js"></script>
<a class="fancybox" id="single_image" href="http://fancyapps.com/fancybox/demo/1_b.jpg" title="title" 
                  width="200">
  <img src="http://fancyapps.com/fancybox/demo/1_b.jpg"  width="300"  alt=""></a>

JavaScript

$(document).ready(function() {
    $("#single_image").fancybox({
        onComplete: function () {
            $("#fancybox-img").wrap($("<a />", {
                href: this.href, //or your target link
                target: "_blank"
            }));
        }
    });
});