开发者

Using prettyPhoto jQuery with my photo gallery [duplicate]

开发者 https://www.devze.com 2023-03-28 03:17 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicat开发者_如何学Pythone:
This question already has answers here: Closed 11 years ago.

Possible Duplicat开发者_如何学Pythone:

Implementing the prettyPhoto jQuery plugin

I am working on a web site and would like each photo to be opened up with the jQuery lightbox plugin called prettyPhoto. I have included these files in the head but it seems that they are not being recognized. It says on this page that all I need to do is add the rel="prettyPhoto" to my link tag. I am pretty much a JavaScript and jQuery newbie, so any help would be appreciated.

Here is the link to my site:

http://mcmach.com/mcmachine/photogallery.html


firstly include only one version of jQuery in your head (best would be 1.4.4)

Then i suppose the main CSS files for the functioning of prettyPhoto is missing (prettyPhoto.css)

Remove the target tag from all the photos

and you have also not included the JavaScript snippet to link it to the lightbox ,Here it is:

<script charset="utf-8" type="text/javascript">
$(document).ready(function(){ 
$("a[rel^='prettyPhoto']").prettyPhoto();  
});  
</script> 

For more details check out http://www.stylifyyourblog.com/2011/06/prettyphoto-is-jquery-lightbox-clone.html

0

精彩评论

暂无评论...
验证码 换一张
取 消