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

Home Forums JavaScript AnythingSlider onInitialized bug?

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #39758


    I have a slider where every single slide has a (hidden) div with text in it. On “onSlideComplete” I switch text in a div outside of the actual slider by $(‘#slider .activePage .caption’).html().

    I want to do the same thing on “onInitialized”. onInitialized is supposed to be “Callback when the plugin finished initializing”.

    But it’s not working. The class “activePage” is not set on onInitialized. BUT here’s the strange thing: if I add a setTimeout(function () {
    My code
    }, 1);
    it works. Am I doing something wrong with the callback or is this a bug?


    Hi Frantiq!

    It sounds like [this demo]( might be doing what you want. I wouldn’t recommend using the `activePage` class since it isn’t added until have the slide has completed animation.

    var updateCaption = function(slider){
    var cap = slider.$currentPage.find(‘.caption’).html();


    // *********** Callbacks ***********
    // Callback when the plugin finished initializing
    onInitialized: function(e, slider) { updateCaption(slider); },

    // Callback before slide animates
    onSlideBegin: function(e, slider) {

    // Callback when slide completes – no event variable!
    onSlideComplete: function(slider) { updateCaption(slider); }



    Thanks Mottie, that worked like a sharm :)

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