我正在尝试使用firebug API,但是firebug说$.prettyPhoto.open()不是一个函数,因此无法工作……
代码:http://jsbin.com/ihuje3/3/edit
$(document).ready(function(){
$.prettyPhoto.open('http://www.microdual.com/assets/images/newsletters/doublehosting.jpg','Test','Test desc');
});
发布于 2010-11-24 20:11:49
您必须首先设置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');
});
像$.prettyPhoto.open()
这样的函数是通过运行`$来定义的You can see in the source。
另一个问题是这个插件在jQuery 1.4.4中引入的调用者上下文似乎有问题,它在1.4.3 (you can test it here)中工作得很好。This has been reported on the forums,希望作者能尽快解决这个问题。
https://stackoverflow.com/questions/4266097
复制相似问题