如何用Django Endless Pagination显示ajax加载图标?

时间:2014-02-15 02:35:40

标签: jquery ajax django django-endless-pagination

我正在使用Django无尽的分页

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

2 个答案:

答案 0 :(得分:0)

您必须覆盖模板

endless / 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 %}

答案 1 :(得分:0)

在settings.py中设置图像:

ENDLESS_PAGINATION_LOADING =“”

此处列出了所有其他选项:

http://django-endless-pagination.readthedocs.org/en/latest/customization.html