我正在尝试使用angular加载flexslider但事情是我无法让键盘选项工作。任何人都可以告诉我我做错了什么
$scope.loadFlexSlider = function(){
debugger;
console.log("loadBxSlider");
angular.element('#carousel').flexslider({
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
itemWidth: 210,
itemMargin: 5,
asNavFor: '#slider'
});
angular.element('#slider').flexslider({
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
sync: "#carousel",
keyboard: true
});
更新
有没有办法手动控制键盘移动
答案 0 :(得分:2)
由于您正在与缩略图同步,我相信您需要添加multipleKeyboard:true。我在代码的末尾添加了它:
$scope.loadFlexSlider = function(){
debugger;
console.log("loadBxSlider");
angular.element('#carousel').flexslider({
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
itemWidth: 210,
itemMargin: 5,
asNavFor: '#slider'
});
angular.element('#slider').flexslider({
animation: "slide",
controlNav: false,
animationLoop: false,
slideshow: false,
sync: "#carousel",
keyboard: true,
multipleKeyboard: true
});