0

我正在使用 prettyPhoto 打开一个 ajax 窗口:http ://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/

这是我打开窗口的链接

<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>

在comment.php 里面我有一个div,当它全部加载时,我希望它滚动到底部。我有这么回复评论,将 div 滚动到底部,我只是无法弄清楚 ajax 窗口的加载。有任何想法吗?

4

1 回答 1

2

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.

于 2012-03-02T23:37:21.703 回答