Disable link in jQuery paging menu

Asked

Viewed 253 times

0

I have a paging plugin made in jQuery.
What I can’t do is when I’m on the last page, the link that gives access to the next page is disabled and the user can’t click anymore. Similarly the button gives access to the previous page. I’ve already followed some tips, how to insert "disable" but it doesn’t work. Add the "little hand" in the link but you can still click. The following method was created to customize the two links

function tagNextPrev() {
        if($nav_panels.children('.last').hasClass('active_page')){
            $nav_panels.children('.next_link').add('.last_link').removeClass('.next_link').addClass('no_more');
        } else {
            $nav_panels.children('.no_more').add('.last_link').removeClass('no_more');  
        }

        if($nav_panels.children('.first').hasClass('active_page')){
            $nav_panels.children('.previous_link').add('.first_link').addClass('no_more');
        } else {
            $nav_panels.children('.previous_link').add('.first_link').removeClass('no_more');
        }
    }

1 answer

3


  • 1

    Thank you very much, it worked perfectly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.