0

现在我尝试在我的 Angular 项目中实现swiper插件,除了 ie8 及以下版本外,工作正常。错误:

SCRIPT5007: Unable to get property 'replace' of undefined or null reference 
idangerous.swiper-2.2.js, line 2190 character 10

在插件的行上,它transformmatrix. 但它似乎找不到任何要交换的元素。

我的指令

// Slider / Swiper Plugin
app.directive('swipe', function(){
    return {
        restrict: 'A',
        link: function (scope, element, attrs) {
            var slider = $(element).swiper(scope.$eval(attrs.swipe));
            $('.swipe__prev').on('click', function () {
                slider.swipePrev();
            });
            $('.swipe__next').on('click', function () {
                slider.swipeNext();
            });
            $(element).find('.swipe__pagi__element').on('click', function () {
                slider.swipeTo($('.swipe__pagi__element').index());
            });
        }
    };
});

我的 HTML:

<div class="swiper-container swipe__container grid__item" swipe="{
        mode: 'horizontal',
        loop: false,
        autoplay: 5000,
        wrapperClass: 'swipe__wrapper',
        slideClass: 'swipe__slide',
        slidesPerView: '3',
        createPagination: false
    }">
        <div class="swipe-wrapper swipe__wrapper">
            <div class="swiper-slide swipe__slide">
                <img src="../images/slider_pic_01.jpg" alt="Gewinn 1">
            </div>
            .......
            <div class="swiper-slide swipe__slide">
                <img src="../images/slider_pic_15.jpg" alt="Gewinn 15">
            </div>
        </div>
    </div>
    <span class="swipe__prev"><i class="icon-caret-left"></i></span>
    <span class="swipe__next"><i class="icon-caret-right"></i></span>
    <div class="swipe__pagi"></div>

该插件在 IE8的演示页面上运行良好。它的构建与演示中的相同......所以我猜它的角度......

任何人都可以帮助或给我一个提示吗?

4

1 回答 1

0

我解决了我现在觉得很愚蠢的问题。轻松回答。我调用的元素swipe-wrapper,但我的 css 文件说swipeR-wrapper

于 2013-10-31T11:19:46.573 回答