2

我想在我的页面上实现jQuery插件prettyPhoto。我从这个页面使用的示例: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> 
+1

**没有看到任何代码,任何人都可能能够协助**请参阅:http://tinyurl.com/so-hints – Sparky 2012-02-01 06:53:49

+0

现在更清楚了吗? – 2012-02-01 07:08:02

+0

国际海事组织,错误是,如果你没有正确包括jQuery或插件。您是否在prettyPhoto插件中加入了jQuery _before_?你是在调用'.prettyPhoto()'_after_吗?他们看起来像是明显的问题,但没有人能看到你的代码的一部分。这几乎就像你没有阅读我的第一条评论中的链接。 – Sparky 2012-02-01 07:13:01

回答

3

看起来这个错误与PrettyPhoto 2.5.x和jQuery 1.3.2有关 - 那个prettyphoto版本不适用于较新版本的jQuery。

所以,如果你想prettyPhoto 2.5.x工作,你必须使用jQuery 1.3.2。

+0

终于感谢您的帮助。 – 2012-02-06 08:07:18