I am trying to implement the prettyPhoto jQuery plugin on this web page.
http://mcmach.com/mcmachine/photogallery.html
I want to use the single image option
This comes directly from the documentation for that plugin:
<a href="images/fullscreen/2.jpg" rel="prettyPhoto" title="This is the description">
<img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="This is the title" />
</a>
Here are some big problems I found on your page...
In the <head>
section, you have this...
<script type="text/jscript" src="JS/jquery.prettyPhoto.js"></script>
<script type="text/jscript" src="JS/jquery-1.3.2.min.js"></script>
<script type="text/jscript" src="JS/jquery-1.4.4.min.js"></script>
<script type="text/jscript" src="JS/jquery-1.6.1.min.js"></script>
First problem: You're including prettyPhoto before jQuery. You'll need to "include" jQuery before any jQuery plugins.
Second problem: You're including three versions of jQuery. You cannot "include" more than one version or instance of jQuery. For some reason, you're including and loading versions 1.3.2, 1.4.4 and 1.6.1. Just use the latest one.
Third problem: You're not invoking prettyPhoto. After you "include" the plugin, you'll need to call it using JavaScript.
It should all look something like this...
<script type="text/javascript" src="JS/jquery-1.6.1.min.js"></script>
<script type="text/javascript" src="JS/jquery.prettyPhoto.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('a[rel^="prettyPhoto"]').prettyPhoto({
// any configuration options as per the online documentation.
});
});
</script>
Sidenote: For the most efficient page loading, please read my answer in this thread about placing your JavaScript includes at the end of the <body>
section just above the </body>
tag.
CSS: You're also missing the link to the CSS file for prettyPhoto. This should be in the <head>
section of your page.
<link rel="stylesheet" type="text/css" href="/path/to/prettyPhoto.css" media="screen" />
Your HTML:
<a href="images/fullscreen/2.jpg" rel="prettyPhoto" title="This is the description">
<img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="This is the title" />
</a>