I am trying to implement Prettyphoto with another javascript library that does not use in links to the images. Is there a way to call Prettyphoto when an just image or div is clicked ( no )rather than using a traditional link. I tried to use the API but have had no luck.
Using the API, $.prettyPhoto.open would work, but it would be ugly because you'd have to attach all of those events to a click event - which is what the $("a[rel=^'prettyPhoto']").prettyPhoto(); code does for you.
Based on the source of 2.5.6, prettyPhoto needs it to be in an (it has 'a[rel' selectors hardcoded in the source). I assume it was written that way so that if the prettyPhoto javascript failed to load, when you clicked the image, it would still bring you to the larger size, but that's just a guess.
I did get it to work, partially using $(".item[rel^='prettyPhoto']").prettyPhoto(); , where "item" is the class of the image I want to open in prettyphoto. It seems the javascript I am trying to integrate it into ( it's a coverflow type script) adds the additional class "active" to the image that is centered. When I click on the non centered images, prettyphoto opens as it should but when I click on the centered "active" image I get "$ppt is undefined". Not sure why I get this error.
I'm working on almost the same exact issue: I'm using contentflow and prettyPhoto together. However, when I click on the centered image, it opens on a new page. Then when I click my browser's back button, PP works. I too have the issue of clicking on a non-centered item and PP working just fine, but it shouldn't: It should instead bring that non-centered image to the front.
I'll be checking back to see if you get any traction on this.
To get prettyPhoto to work with Content flow you need to remove the ability to click images in content flow. To do this open contentflow.js in a word editor, find all instances of onclickActiveItem and remove the value within the parentheses. This disables the onclick feature in conent flow and allows prettyPhoto to work as it should as long as you've put rel tags on the link.
This is just how I did it and I know nothing about java so there's probably a better way but it works for me. Make sure to backup the contentflow.js before you edit anything.