PrettyPhoto doesn't work, no console errors

Here is the code in my <head> :

 <!-- Pretty Photo --> <link rel="stylesheet" href="/css/prettyPhoto.css" type="text/css" media="screen" title="prettyPhoto main stylesheet" charset="utf-8" /> <script src="/js/jquery.prettyPhoto.js" type="text/javascript" charset="utf-8"></script> 

Here is the image I'm trying to upload to the viewer.

 <div class="altImage"> <a href="http://scoutsamerica.com/uploads/485604_10201093620571706_1239548317_n_716437.jpg" rel="prettyPhoto"> <img src="http://scoutsamerica.com/uploads/485604_10201093620571706_1239548317_n_716437.jpg"> </a> </div> 

I donโ€™t understand so many times and why it doesnโ€™t work. Any ideas?

+4
source share
2 answers

In the documentation:

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

Source: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/prettyphoto-faqs/

You will also need to import the jQuery standard library to use jQuery plugins!

+5
source

TymeJV's answer was helpful, but still didn't work. This happened, however:

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

Source: https://habr.com/ru/post/1483044/


All Articles