Base64String 圖像在 fancybox 打開

<a href="#myBase64String" class="fancybox" rel="group">
  <img src="data:image/jpg;base64,@Convert.ToBase64String(Model.Image)" alt="" id="myBase64String" />
</a>
$('[data-fancybox="images"]').fancybox({
  beforeLoad : function(instance, current) {
    if (current.src=== '#') {
    current.src = current.opts.$orig.find('img').attr('src');
    }
  }
});

內容出處: jquery – Fancybox Base64String image disappears when fancybox opens – Stack Overflow