سؤال

I am currently using Sudo Slider and it is working perfectly. I am attempting to implement an additional option and cannot get it to work-- most likely due to my limited experience with jquery.

I would like to hide the controls on the first slide as there is an alternative "thumbnail" navigation on that slide. By default, Sudo Slider hides the "previous" button on the first slide and the "next" button on the last slide. This seems like it should be easy to hide both the "previous" and "next" buttons on the first slide.

I simplified my code in this JsFiddle which brought about another problem-- I am also new to JsFiddle and cannot get the fiddle to use the external source for Sudo Slider I currently have hosted on a website. So, this ultimately ends up being a two part question:

1- How do I get Sudo Slider to hide the controls on a specific slide?

2- How do I link Sudo Slider to my JsFiddle?

Any help would be appreciated. Thanks!

PS: Here is a code snippet as Stack won't allow a link to JsFiddle without some code:

$(document).ready(function(){

var sudoSlider = $("#slider").sudoSlider({
    customLink:'a.customLink',
    prevNext:false,
    updateBefore: true,
    currentFunc: function(t){
       if (t != 1) $('#controlsId').stop().fadeTo(500, 1);}

});

هل كانت مفيدة؟

المحلول

You JsFiddle included the external script just fine, you just had some syntax errors in your script.

currentFunc was removed from SudoSlider in version 3.0.0, so i don't know why you are trying to use that.

Was it something like this you were looking for? http://jsfiddle.net/eS5gQ/3/

var sudoSlider = $("#slider").sudoSlider({
    customLink:'area.customLink, a.customLink',
    prevNext:false,
    updateBefore: true,
    afterAnimation: function(t){
        if (t != 1) {
            $('#controlsId').stop().fadeTo(500, 1);
        }
    },
    beforeAnimation: function (t) {
        if (t == 1) {
            $('#controlsId').stop().fadeTo(500, 0);    
        }
    }
});

I made the slider go to slide number 2 after 2 seconds, to emulate someone clicking a thumbnail in your thumbnail navigation.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top