Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript AnythingSlider – on slide change call function

  • This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #33963
    fri3ndly
    Member

    Has anybody got any idea how to do this?

    I need to run a function every time the slide changes.

    I know there is no native way of ‘listening’ for HTML changes with jQuery which is how I have tried to do it, but has anyone got another idea?

    #85182
    jamygolden
    Member

    I’ve never done this myself with AnythingSlider before, but I think this should work:

    $('#slider').anythingslider({
    onSlideComplete: function(){
    // Whatever you want to happen once each slide completes
    })
    });
    #85184
    fri3ndly
    Member

    Hello

    Thanks for the reponse. I didnt know about that callback. I have tried it but it seems to break my script:


    $('#splash ul').anythingSlider({
    onSlideComplete: function(){ alert('test'); })
    });
    #85185
    fri3ndly
    Member

    Ahh fixed – didnt need the function closing bracket ;-)


    $('#splash ul').anythingSlider({
    onSlideComplete: function(){ alert('test'); } <
    });
    #85188
    jamygolden
    Member

    Lol, oh right, obviously!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.