Prettyphoto is not working

I can’t make it work, someone there can help

I use it in my head

<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <link rel="stylesheet" href="css/prettyPhoto.css" type="text/css" media="screen"/> <script src="js/jquery.prettyPhoto.js" type="text/javascript"></script> 

I use this for photos

 rel="prettyPhoto[pp_gal]">< 

I use this before the closing tag

 <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto({ animationSpeed: 'normal', /* fast/slow/normal */ padding: 40, /* padding for each side of the picture */ opacity: 0.35, /* Value betwee 0 and 1 */ showTitle: true, /* true/false */ allowresize: true, /* true/false */ counter_separator_label: '/', /* The separator for the gallery counter 1 "of" 2 */ theme: 'light_rounded' /* light_rounded / dark_rounded / light_square / dark_square */ }); }); </script> 

I linked pretexthoto CSS to my document. What should I do with jquery.js and jquery-1.3.2.min.js folders?

+6
javascript jquery css
source share
2 answers
  • Make sure the js and css folders are relative to the current page. For example, if you are working on http: //localhost/photogallery/index.html , make sure that the 3 folders included in your prettyPhoto file are checked out at http: // localhost / photogallery / and not the root of your server.
  • Make sure you have a prettyPhoto β€œimages” folder. It includes a number of topics and other resources necessary to make prettyPhoto look right.
  • A conflicting library or jQuery version may stop pretty much equally from loading. Try to run prettyPhoto on a blank page with only the necessary scripts and CSS, and a couple of image links with rel = "prettyPhoto [pp_gal]". If this works, and when you return the code to your page, it does not work, you may know that something is conflicting on the page with prettyPhoto or jQuery.
  • Check for errors on the page. Internet Explorer has tools for developers. Firefox has Firebug. Chrome has developer tools. Search the web for how to use one specific for your favorite browser.
+4
source share

As Dawson said in his answer number 4, make sure you don't have javascript errors on your page that could stop prettyPhoto from loading correctly.

I hit my head on the keyboard for 2 hours since it did not work for me. In Firefox, I used Tools> Web Developer> Error Console to see that I have JavaScript code from another widget using the error. I commented on this line and it worked correctly.

Check the check and check again.

0
source share

All Articles