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