我正在尝试在我的页面上实现 jQuery 插件 PrettyPhoto。我使用了此页面中的示例:
http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/#!prettyPhoto
当我使用 rel="prettyPhoto[pp_gal]"
时,我收到一条有关错误语法的错误消息:
Error: Syntax error, unrecognized expression:
[rel*=[pp_gal]
可能是什么问题?
我已经在我的项目中安装了 PrettyPhoto jQuery 插件。我已将此脚本放入 页面:
$(document).ready(function () {
$("a[rel^='prettyPhoto']").prettyPhoto();
});
我使用这个 HTML 来查看图像,路径是 localhost,因为我现在只是想让它工作:
<a href="../GalleryImages/ScreenClip[1].png" rel="prettyPhoto[pp_gal]"><img src="../GalleryImages/ScreenClip[1].png" width="60px" height="60px" alt="Nice building" /></a>
<a href="../GalleryImages/1.jpg" rel="prettyPhoto[pp_gal]"><img src="../GalleryImages/1.jpg" width="60px" height="60px" alt="Nice building" /></a>
最佳答案
该错误似乎与 PrettyPhoto 2.5.x 和 jQuery 1.3.2 有关 - 该版本的 Prettyphoto 不适用于较新版本的 jQuery。
因此,如果您希望 PrettyPhoto 2.5.x 正常工作,则必须使用 jQuery 1.3.2。
关于jQuery PrettyPhoto 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9091931/