2014-02-15 41 views
0

我使用Django的無盡分頁如何使用Django EndlessPagination顯示ajax加載圖標?

https://github.com/frankban/django-endless-pagination

現在,而不是顯示圖形加載圖標它只是顯示單詞「加載」。有可能以某種方式顯示圖形圖標嗎?我在選項列表中沒有看到爲圖標設置網址的任何內容。

 var defaults = { 
     // Twitter-style pagination container selector. 
     containerSelector: '.endless_container', 
     // Twitter-style pagination loading selector. 
     loadingSelector: '.endless_loading', 
     // Twitter-style pagination link selector. 
     moreSelector: 'a.endless_more', 
     // Digg-style pagination page template selector. 
     pageSelector: '.endless_page_template', 
     // Digg-style pagination link selector. 
     pagesSelector: 'a.endless_page_link', 
     // Callback called when the user clicks to get another page. 
     onClick: function() {}, 
     // Callback called when the new page is correctly displayed. 
     onCompleted: function() {}, 
     // Set this to true to use the paginate-on-scroll feature. 
     paginateOnScroll: false, 
     // If paginate-on-scroll is on, this margin will be used. 
     paginateOnScrollMargin : 1, 
     // If paginate-on-scroll is on, it is possible to define chunks. 
     paginateOnScrollChunkSize: 0 
    }, 
+0

你可以在頁面上有一個img元素並調整loadingSelector以包含它嗎? – schillingt

回答

0

你要覆蓋一個模板

無休止/ show_more.html - 放有loading.gif :)

{% load i18n %} 
{% load static %} 
{% if querystring %} 
    <div class="clearfix"></div> 
    <div class="endless_container"> 
     <a class="endless_more" href="{{ path }}{{ querystring }}" 
      rel="{{ querystring_key }}"> 
      <button>Więcej</button></a> 
     <div class="endless_loading" style="display: none;"> 
      <img src="{% static "img/ajax-loader.gif" %}"></div> 
    </div> 
{% endif %} 
相關問題