jQuery   发布时间:2022-04-19  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jQuery:PrettyPhoto API不工作大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图使用prettyPhoto 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');
});
​

解决方法

您必须首先设置prettyPhoto(因为插件是不可写的),像这样:
$(document).ready(function(){
  $.fn.prettyPhoto(); //usually $("a[rel^='prettyPhoto']").prettyPhoto();
  $.prettyPhoto.open('http://www.microdual.com/assets/images/newsletters/doublehosting.jpg','Test desc');
});

像$ .prettyPhoto.open()这样的功能,通过运行`$。

一个问题是插件似乎在jQuery 1.4.4中引入了调用者上下文的问题,它的工作正常,1.4.3(you can test it here)。 This has been reported on the forums,希望作者能尽快解决

大佬总结

以上是大佬教程为你收集整理的jQuery:PrettyPhoto API不工作全部内容,希望文章能够帮你解决jQuery:PrettyPhoto API不工作所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: