Вопрос

I am using slides.js for one of my projects; however, the autoplay feature is not working properly.

Here is what I am doing:

$('#slides').slides({
    width: 600,
    height: 120,
    generateNextPrev: false,
    pagination: false,
    play: 1000
});

The documentation http://slidesjs.com/ says that by giving a positive number to play, autoplay should work. Can someone help?

Это было полезно?

Решение 4

I don't know why it works this is something which is not given in the documentation :-

$(function(){

    $('.slides').slides({
        width: 600,
        height: 120,
        pagination: false,
        previous: false
    });

    $('.slides').slides("play");
});

Другие советы

I know this has been answered, but the function is actually .slidesjs NOT .slides

For SlidesJS-3 you can use the following to trigger autoplay :

$(".slides").slidesjs({
        width: 768,
        height: 158,
        play: {
            auto: true
        }
});

check the scripts loaded are not if yes then that should be in sequence like

  1. script src="http://code.jquery.com/jquery-latest.min.js"
  2. script src="slides.js"
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top