Question

I am opening a an ajax window using prettyPhoto: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/

This is my link to open the window

<a rel="prettyPhoto[ajax]" href="resources/comments.php?ajax=true&width=500&height=460&projectid=<?php echo $result['id']; ?>" class="buttonPro medium grey" id="commentsButton" data-projectid="<?php echo $result['id']; ?>">Comments</a>

Inside comment.php I have a div that when its all loaded, I want it to scroll to the bottom. I have it so replying to a comment, scrolls the div to the bottom, I just cant figure out the onload of the ajax window. Any ideas?

Was it helpful?

Solution

According to the documentation: http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/documentation/ there is not an option for a ajax callback(). It only appears to have callbacks for changing the picture or closing prettyPhoto.

I added the ajax callback to a fork I made: https://github.com/chrisabrams/prettyphoto

Just make sure to add this:

$("a[rel^='prettyPhoto']").prettyPhoto({
    ajaxcallback: myfunction() {},
    //other options here
});

Let me know if it works and I'll pull request it to the main repo.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top