Lightbox using tags or

Is there any lightbox implementation that allows you to use <a href=base64-string" instead of the actual URL?

+4
source share
3 answers

Yes, I think you can use Slimbox . It has its own LinkMapper function . This allows you to return any URL you want based on the item you are currently working on. This is javascript, so you can execute an ajax request or any other link you want to return.

So yes, you need jQuery for this, but I think there is a version of Mootools. Look at this.

+2
source

You only noted javascript, but if you can use jQuery, you can use fancybox to achieve this with a little work:

 $("a[href^='data:image']").each(function(){ $(this).fancybox({ content: $("<img/>").attr("src", this.href) }); }); 

Jsfiddle sample code

+5
source

I need to replace href with data-remote as follows:

 <a data-remote="{{ base64string }}" data-gallery="multiimages" data-toggle="lightbox"> <img src="{{ base64string }}" /> </a> 
+1
source

Source: https://habr.com/ru/post/1347455/


All Articles