0

I'm trying to use iosSlider, but I'm unable to link to the slides.

I'm using the following function here to add the current slide's number to the URL, which is working fine, but linking to these always loads the first slide instead of #3, #4...

function slideContentChange(args) {

    window.location.href =  '#' + args.currentSlideNumber

    /* indicator (original code) */
    $('.iosSliderButtons .button').removeClass('selected');
    $('.iosSliderButtons .button:eq(' + args.currentSlideNumber + ')').addClass('selected');

}

What am I missing?

4

1 回答 1

1

我在准备好的文档中使用它:

var hash = window.location.hash || '1';
var startSlide = hash.replace("#", "");             
//alert(startSlide);

$('.iosSlider').iosSlider({
    // other init variables..
    startAtSlide: startSlide
});

这有帮助吗?

于 2012-11-06T00:18:06.827 回答