-
-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Labels
Description
Hi,
I'm trying to use the Fancybox library in the sidebar of a map made with leaflet 1.3.1.
When I click on a marker, I get from the database a list of photos associated to the marker. Then I open the sidebar to display them inside the sidebar with Fancybox, but photos don't "open" with fancybox (then open in a new tab of the browser).
The code works fine if it's not contained in the leaflet sidebar.
<a class="fancybox thumbnail" rel="gallery" href=myphoto.jpg" title="myphoto">
<img class="img-responsive" src="myphoto.jpg"/>
</a>
<script>
$(function() {
$(".fancybox").fancybox({
'titlePosition' : 'inside'
});
});
</script>
I found a similar question about using fancybok in a leaflet popup, but it does not change anything when I specify in my leaflet map javascript:
$(function() {
my_map.control.sidebar.on('shown', function () {
$(".fancybox").fancybox({
'titlePosition' : 'inside'
});
});
});
Any idea?
Thanks!
Reactions are currently unavailable