[ACCEPTED]-Disabled link in Bootstrap Pagination-anchor
Accepted answer
In the docs, those buttons are just disabled 5 manually. It has nothing to do with the 4 .pagination
styling.
You could use that
$('.pagination .disabled a, .pagination .active a').on('click', function(e) {
e.preventDefault();
});
Note: If you 3 use an ajax based pagination you have to 2 put this piece of code in the update handler 1 or use delegated events instead
If you write the html dynamically server 2 side (with django for example) and you don't 1 want to use javascript you could do this:
pseudo code:
if (Model.HasNext()) {
<li> // normal link
<a href="www.someurl.com/page=i">next</a>
</li>
} else {
<li class="disabled"> // disabled link
<a href="javascript: void(0)">next</a>
</li>
}
As a reference, here is what Bootstrap does:
&.disabled,
&[disabled] {
cursor: not-allowed;
pointer-events: none; // Future-proof disabling of clicks
.opacity(.65);
.box-shadow(none);
}
0
$('.disabled a').click(function(){
return false;
});
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.