简体   繁体   中英

How can I get the number of the loaded panel in Coda Slider 3?

I've implemented the Coda Slider 3.0 ( this one ) and I need to get the URL of the image which is currently displaying. Does anyone know how to do this?

I know there is a setting called "firstPanelToLoad", so I figured there must be some way to get the number of the current panel.

I ended up adding my own functionality in the javascript. I added another option to $.fn.liquidSlider.options which become my custom callback function:

$.fn.liquidSlider.options = {
...
swipe: true,
swipeArgs: undefined,
customCallback: function(currentSlide) {}
};

And then in the setNextPanel function you can call your custom callback with the currently selected panel:

setNextPanel: function(direction) {
...
    self.options.customCallback(self.nextPanel);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM