2010-11-24 47 views

回答

37

你不得不安裝prettyPhoto第一(因爲插件是怎麼寫的,不幸的是),像這樣:

$(document).ready(function(){ 
    $.fn.prettyPhoto(); //usually $("a[rel^='prettyPhoto']").prettyPhoto(); 
    $.prettyPhoto.open('http://www.microdual.com/assets/images/newsletters/doublehosting.jpg','Test','Test desc'); 
}); 

You can see in the source該功能,如012通過運行`$來定義。

另一個問題是該插件似乎與jQuery 1.4.4中引入的調用者上下文有問題,它與1.4.3(you can test it here)正常工作。 This has been reported on the forums,希望作者能很快解決它。

+1

感謝Nick;)在我的另一個腳本中,我已經啓動prettyPhoto,但在不同的腳本上。 ;) – CuSS 2010-11-24 12:28:05