2013-04-17 106 views
0

傢伙我使用一個插件自動加載當我向下滾動,這是我的jQuery代碼:更新ATTR價值

jQuery('#displayimagesDiv').scrollExtend(
       { 

        'target': '#displayimagesDiv',   
        'url': $('#nexturl:last').attr('href'), 
        'loadingIndicatorEnabled' : true, 
        'loadingIndicatorClass' : 'loading', 
        'onSuccess' :{} 

       } 
      ); 

的HTML代碼:

<a id="nexturl" href="{{URL::current()}}?page={{$images->page+1}}" style="display:none">#</a> 

問題當我第一次滾動它不會更新#nexturl:最​​後選擇器值的值,所以我每次都得到舊網址(example.com/?page=1)而不是(example.com/?page=2) )。 任何幫助PLZ。

+0

一些HTML代碼來顯示?也許是「nexturl」節點。 – RicardoGonzales

+0

完成親愛的看到更新後的文章 – Hamza

回答

1

嘗試用一個函數替換爲 'url' 參數:

jQuery('#displayimagesDiv').scrollExtend(
    { 

     'target': '#displayimagesDiv',   
     'url': function() { return $('#nexturl:last').attr('href'); }, 
     'loadingIndicatorEnabled' : true, 
     'loadingIndicatorClass' : 'loading', 
     'onSuccess' :{} 

    } 
); 
+0

它不起作用親愛的 – Hamza