AnythingSlider is undefined
===

I'm using the AnythingSlider jquery plugin for a photogallery and I'm having some problems in customizing it.

The slider works, but right now I want to show the current slide number and the total number and I'm getting an error in Firebug.

The script is this:


    $(function() {
    
    var current = $('#gallery').data('AnythingSlider').currentPage;
    var pages = $('#gallery').data('AnythingSlider').pages;
    $('.slides').append(current + '/' + pages);

    $('#gallery').anythingSlider({
        appendBackTo: '.arrow-left',
    appendForwardTo: '.arrow-right',
    buildNavigation: false,
    buildStartStop: false,
    easing: 'linear',
    resizeContents: false
        //expand: true
    })
    });

Without the first 3 lines it works, but with that Firebug says $("#gallery").data("AnythingSlider") is undefined.