0

ループは、var westring を使用して最後の li を返します。投稿の URL に添付または追加する方法はありますか?

  $(document).ready(function() {

    var westring = '0';

    $('#infinite_topic_scroll').scrollLoad({ 
    url : '/challenges_side.php?f=hh&start_res='+westring+'&v=y', 
    getData : function() {  },
    start : function() { $('<div class="loading"><img src="/images/ajax-loader.gif"/></div>').appendTo(this); },
    ScrollAfterHeight : 95,
    onload : function( data ) {
    $(this).append( data );
    $('.loading').remove();     
    },
    continueWhile : function( resp ) {

    var westring = ($(this).children('li').length);

    // alert(westring);

    if( $(this).children('li').length >= 100 ) { return false; }
    return true;
        }
        }); 
    });
4

2 に答える 2

1

I can't find much on the plugin you're using specifically, but I think what you're looking for is in...

getData : function() {  }

Try something like this...

[...]
url : '/challenges_side.php', 
getData : function() 
{  
    return {
        "f" : "hh",
        "v" : "y",
        "start_res" : $(this /* or element selector */).children('li').length.toString()
    };
},
[...]

I could be wrong, but it's worth a shot

于 2012-12-21T22:42:45.190 に答える