$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
How do I get this to load onload instead of when clicked?
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
How do I get this to load onload instead of when clicked?
You could try:
$("a[rel^='prettyPhoto']").prettyPhoto().click();
That should trigger a click event on the link after attaching the prettyPhoto events to it. I imagine it'll break if you have more than one prettyPhoto link on the page, though.
Looking at the prettyPhoto documentation, you can do any of the following directly in your script.
$.prettyPhoto.open('images/fullscreen/image.jpg','Title','Description');
$.prettyPhoto.changePage('next');
$.prettyPhoto.changePage('previous');
$.prettyPhoto.close();