angular 里面无法使用滑动插件<!-引入swiper样式 --><link rel="stylesheet" href="swiper.min.css" media = "all"><!-- 引入swiper插件 --><script type="text/javascript" src = "swiper.min.js"></script> <script type="text/javascript"> var mySwiper = new Swiper('.swiper-container',{ autoplay:2500, loop:true, autoplayDisableOnInteraction:false, pagination : '.swiper-pagination', paginationClickable: true, longSwipesRatio: 0.3, touchRatio:1, observer:true,//修改swiper自己或子元素时,自动初始化swiper observeParents:true,//修改swiper的父元素时,自动初始化swiper}) </script> <div id="test"></div> <div id="log_window"> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide">Slide 1</div> <div class="swiper-slide">Slide 2</div> <div class="swiper-slide">Slide 3</div> </div> <!-- Add Pagination --> <div class="swiper-pagination"></div></div></div>
1 回答
泛舟湖上清波郎朗
TA贡献1818条经验 获得超3个赞
可以用 初始化的时候加载一次
<li ng-repeat="item in prodList" repeat-done="showAll()"></li>
.directive('repeatDone',function(){
return{
link:function(scope,element,attrs){
if(scope.$last){
scope.$eval(attrs.repeatDone);
}
}
}
})
添加回答
举报
0/150
提交
取消