获取当前图像数据Flexslider

时间:2016-04-13 07:14:37

标签: javascript jquery flexslider

是否可以从当前的Flexslider图像中提取数据,如图像ID,URL和名称?我需要在flexslider div之外打印当前图像URL。

我现在使用的代码:

jQuery('#slider').flexslider({
 animation: "fade",
 animationSpeed: 0,
 controlNav: false,
 animationLoop: false,
 smoothHeight: true,
 slideshow: false,
 keyboard: true,
 touch: true,
 directionNav: true
});

非常感谢提前

1 个答案:

答案 0 :(得分:0)

您可以使用幻灯片更改后触发的after触发器:

jQuery('#slider').flexslider({
 after: function { // Code that fetches the needed data goes here },
 animation: "fade",
 animationSpeed: 0,
 controlNav: false,
 animationLoop: false,
 smoothHeight: true,
 slideshow: false,
 keyboard: true,
 touch: true,
 directionNav: true
});

可在此处找到功能正常的演示:Jsfiddle