The click disappears the picture, why?



  • Hello!

    http://codepen.io/alex-lenk/pen/JYQMQR Please come and press the picture, and then close the floating window.

    After closing, the picture disappears and is assigned display: none

    How do you fix this obscure colic?

    $("span.fancybox2").clic(function() {
        $(this).attr('data-src', $(this).attr('data-href')).css({
            'display': 'block'
        });
    });
    


  • That's right.

    $(document).ready(function() {
        $(".fancybox2").fancybox();
    });
    

    <a class="fancybox2" href="http://test.artlenk.ru/theme/img/feature-img.jpg"><img src="http://test.artlenk.ru/theme/img/feature-img.jpg" alt="" /></a>




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2