引用Zepto时,为防止$与jQuery或其他JS库的$冲突,对Zepto中的$进行闭包

 

 1 <script src="js/zepto.min.js"></script>
 2 <script type="text/javascript">
 3 $(function($){
 4     var clientWidth=$(window).width();
 5     var clientHeight=$(window).height();
 6     $('.inner').css({'width': clientWidth, 'height': clientHeight + 'px'});
 7 
 8     var swiper = new Swiper('.swiper-container', {
 9         direction: 'vertical',
10         resistanceRatio:0
11     });
12 })(zepto);

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-24
  • 2022-12-23
  • 2021-08-11
猜你喜欢
  • 2021-12-28
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案