无法让 magnific popup 工作,两个 javascript 错误

2022-01-20 00:00:00 popup jquery javascript css magnific-popup

我正在尝试制作一个灯箱画廊并使用了示例源代码.

I am trying to make a lightbox gallery and have used the example source code.

这是我阅读的文档:http://dimsemenov.com/plugins/magnific-popup/documentation.html

Uncaught TypeError: undefined is not a function

Uncaught ReferenceError: $ is not defined 

我不确定错误的含义或如何处理它们.

在我观看的一个视频教程中,他们说 jquery 冲突是一个潜在问题.在网站的另一个页面上,我使用了 Kwicks 滑动菜单(也使用了 jquery).这是我唯一能想到的.

In a video tutorial I watched, they said something about a jquery conflict being a potential problem. On a different page of the website, I used a Kwicks sliding menu (which also used jquery). That's the only thing I can think of.

非常感谢您能给我的任何帮助!

I would really appreciate any help you would be able to give me!

谢谢!没有更多的错误,但现在我需要通过放大放大光标使悬停在图像上工作.

我已经完成了悬停工作,现在我需要进行放大放大光标的工作.我附上了一个页面,说明光标悬停时的样子.

示例:http://dimsemenov.com/plugins/magnific-popup/

我找到了缩放光标!感谢所有的帮助!

推荐答案

插件的文档 Magnific popup 您正在使用的建议 -

The documentation of the plugin Magnific popup you are using suggests -

包括文件

<!-- jQuery 1.7.2+ or Zepto.js 1.0+ -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> 

<!-- Magnific Popup core JS file -->
<script src="magnific-popup/jquery.magnific-popup.js"></script>

记住:您需要包含 jQuery 文件引用,插件才能工作;而是每个 jQuery 插件.并按照指定的顺序.这是 $ not definedundefined in not a function 背后的唯一原因.

Remember : You need to include jQuery file reference, for the plugin to work; rather every jQuery plugin. And in the specified order. This is the sole reason behind $ not defined and undefined in not a function.

相关文章