Pop-up not showing (with magnific-popup)

感情迁移 提交于 2019-11-29 08:44:15

Look at the JavaScript console. You got an error.

Uncaught SyntaxError: Unexpected token < testpopup.html:14

Click on the error message and it takes you to

<script type="text/javascript">
<script type="text/javascript">

There is your problem, you have two opening script tags.

MayMayoO

you should put

(document).ready(function()

inside the body, not the head

ed lovejoy

Problem in your code:

 $(document).ready(function() {
    $('.image-popup-vertical-fit').magnificPopup({
      type: 'image',
      closeOnContentClick: true,
      mainClass: 'mfp-img-mobile',
      image: {
        verticalFit: true
      }
 });

Your problem, you have two opening script tags: });

The proper version of script:

$(document).ready(function() {
    $('.image-popup-vertical-fit').magnificPopup({
      type: 'image',
      closeOnContentClick: true,
      mainClass: 'mfp-img-mobile',
      image: {
        verticalFit: true
      }
  });
});
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!