开发者

Lightbox using tags or <a href=[base64]>

Is there开发者_JS百科 any lightbox implementation that allows using <a href=base64-string" instead of an actual url?


You only tagged javascript, however if you can use jQuery you could use fancybox to achieve this with little work:

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

Code example on jsfiddle


Yes I think you can use Slimbox. It has it's own LinkMapper function. This allows you to return any url you want, based on element you are working on at that moment. This is javascript, so you could do an ajax request or whatever kind of link you want to return.

So yes, you need jQuery for this one, but I think there is a Mootools version as well. Have a look at it.


To me works replacing the href with data-remote as follow,

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜