我有这个功能工作基本的JavaScript功能
<script type="text/javascript">
$(window).scroll(function() {
if ($(window).scrollTop() == $(document).height() - $(window).height()) {
$('div#loadmoreajaxloader').show();
$.ajax({
url: "loadmore.php?wall=<?php echo $wall; ?>&lastid=" + $(".postitem:last").attr("id"),
success: function(html) {
if (html) {
$("#postswrapper").append(html);
$('div#loadmoreajaxloader').hide();
} else {
$('div#loadmoreajaxloader').html('<center><font color="white">No more posts to show.</font></center>');
}
}
});
}
});
</script>
但我需要有同样的事情发生(在iOS设备上),但不是当浏览器到达loadmoreajaxeloader
DIV它发生,我只是需要它发生在链接上的onclick
事件中。感谢堆。
尝试添加代码,但没有格式化所以这里是http://pastebin.com/p2VUqZff
裹Ajax代码的函数里面,然后在链接被点击时调用该函数。 – gpasci 2012-03-29 10:39:26
我对JavaScript的知识真的很低,我怎么能这样做? – 2012-03-29 10:40:12