What is the cause of the error with fancyBox?

When placing several identical links on the page ceases to work correctly opening a popup with inline content: appears for a second and disappears, and the background is dimmed. If one link, then everything is OK.
Reference:
<a data-fancybox="forms" data-src="#order-popup" href="javascript:;"></a>

Initialization:
$('a[data-fancybox="forms"]').fancybox({
 infobar: false,
 touch: {
 vertical: false, 
 momentum: false
}
 });

Hidden block:
<div class="order-popup hide" id="order-popup">
Content
</div>


When placing several links in the address bar already does not site.ru/#forms, and site.ru/#forms-1 site.ru/#forms-2 etc.
June 5th 19 at 21:05
1 answer
June 5th 19 at 21:07
Solution
feel so
$('a[data-fancybox="forms"]').each(function(){
$(this).fancybox(...)
})
If the links need different galleries, do not forget to specify them
data-fancybox="forms-1"
data-fancybox="forms-2"
1) Yes that helped, thank you!
2) No, the contents of one should be. - eldon_Croo commented on June 5th 19 at 21:10

Find more questions by tags fancyBoxJavaScript