Skip to content

disable navPrevSelector/navNextSelector elements when they have no functionality #94

Open
naltatis opened this Issue Aug 30, 2012 · 4 comments

5 participants

@naltatis

When you are on the last page (no infinite mode) the next-button should be given a disabled class so they can be styled separately. Same for the prev button.

@iosscripts

Was unsure about adding this in the beginning because of possible issues with adding class names and then running into conflicts with preexisting styles. You can actually achieve this using the onSlideChange callback with some minor calculations in the callback function.

I will add a class called 'iosDisabled' so that there is no likelyhood of overlapping any preexisting styles. I will also add an option to change this class to anything you want.

@daegloe
daegloe commented Sep 11, 2012

Will this addition be included in the next release?

@dappi
dappi commented Jan 16, 2013

Any update on this?

@marcwhitbread
iosscripts.com member

@dappi this can be achieved by using the onSlideChange callback and then evaluating the currentSlideNumber against the numberOfSlides. If true, add a custom class. The same can be said for slide 1. Like so:

$('.iosSlider').iosSlider({
    onSlideChange: change
})

function change(args) {

    if(args.currentSlideNumber == args.data.numberOfSlides) {
        //add a class to the next button
        //remove class from prev button
    } else if(args.currentSlideNumber == 1) {
        //add a class to the prev button
        //remove class from next button
    } else {
        //remove class from next button
        //remove class from prev button
    }

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.