2010-11-24 113 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