문제

I'm simply looking to hide the "previous" button when you're on, let's say, page 1 of page 10. Because why need the "previous" button there if you can't go back more? Also, I would like to hide the "next" button when you're on the last page (page 10 of page 1), because again, you can't go further, so why have a "next" button on the last page?

I'm using BigCartel, and the variables for the code look like this:

{% if paginate.previous.is_link or paginate.next.is_link %}
{{ paginate | default_pagination }}
{% endif %}
% else %}
<p class="alert-noproducts">No products found.</p>
{% endif %}

The CSS looks like this:

#pagination .disabled,
#pagination .next,
#pagination .previous {
display: inline;
}
도움이 되었습니까?

해결책

use this:

#pagination .previous.disabled { display:none; }

you will also want to add this for when you're on the last page:

#pagination .next.disabled { display:none; }

You can combine them as well:

#pagination .previous.disabled, #pagination .next.disabled { display:none; }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top