in the last days I have been working in this code, the goal was making a whole .div opening the link inside the element. Now what I would like to do is giving this href to featherlightbox, so that it could open it uIf you think there is something easier or better than featherlightbox feel free to advise it to me.
The code (not working yet) is:
$('.o-neuron-hover a').on('click', function(e) {
e.preventDefault(); // stop link
$("#myDiv").load(this.href, function() {
$.featherLight("#myDiv")
});
and the documentation about the even of feather lightbox is:
Bind Featherlight
You can bind the Featherlight events on any element using the following code:
$('.myElement').featherlight($content, configuration);
It will then look for the targetAttr (by default "data-featherlight")
on this element and use its value to find the content that will be opened
as lightbox when you click on the element.
Do you have any idea how can I merge these two elements togheter so that ANY link could open in a lightbox? Sorry but these are my first days touching the JQUERY. Thanks.
You can surely make the code snippet you've used for
#myDivmore generic, for example:Now the only complicated part is to provide that targetId. One possible way is by attaching it to
<a>elements withdata-featherlight-id(or justdata-fl-idfor brevity) attribute, for example: