Angularjs光滑的滑块重新启动

时间:2017-10-06 07:00:16

标签: angularjs slick-slider

我想重新初始化光滑的滑块,所以我为destroy和init创建了以下方法。但它对我不起作用请建议我从控制器重新初始化滑块的任何解决方案

$scope.initSlick = function () {
        $scope.slickConfig2Loaded = true;
        $scope.slickConfig2 = {
            autoplay: true,
            infinite: false,
            autoplaySpeed: 2000,
            slidesToShow: 5,
            slidesToScroll: 5,
            waitForAnimate: false,
            method: {}
        };

    }

    $scope.destroySlick = function () {
        if ($scope.slickConfig2Loaded) {
            $scope.slickConfig2.method.unslick();

        }
    }

0 个答案:

没有答案