Fancybox not working on dynamically added external links

Skip to first unread message

Lalas Muathasim

Nov 20, 2017, 1:45:25 AM11/20/17
to FancyBox

I have a list of items as follows

 <li><a href="http://toExtUrl/img.jpg" class="should-popout">
  <img src=""></a>

toExtUrl/img.jpg is added dynamically and it may sometimes shows pdf or HTML content instead of images(This is always external link). I'm trying to give the fancybox popout effect for whatever comes with href attribute of '.should-popout'.

But while clicking it just redirection to external url happens. My fancybox option is as follows

$(window).on('load', function(){
    'autoDimensions' : true,
    'autoScale' : true
    'hideOnContentClick': true,
    'showCloseButton' : true

What may be the error in the setup.

Reply all
Reply to author
0 new messages