我正在使用http://bxslider.com/作为我的照片库。
我需要获取当前选择传递给另一个变量的图像的路径或 url。
如何获取当前选择的图像的路径或 URL?也就是说,我如何才能获得用户正在查看的图像?
非常感谢你!!:D
我正在使用http://bxslider.com/作为我的照片库。
我需要获取当前选择传递给另一个变量的图像的路径或 url。
如何获取当前选择的图像的路径或 URL?也就是说,我如何才能获得用户正在查看的图像?
非常感谢你!!:D
我没有尝试过,但它应该可以工作onBeforeSlide()
或onAfterSlide()
取决于你想要完成的事情。
function(idx, total, obj){
// You can do this
var src = $(obj).attr('src'); // Not sure if object already wrapped in jQuery
// Or this
var src = $('#slider img').eq(idx).attr('src');
// Rest of the code...
}