Uncaught ReferenceError: Swiper is not defined [ 2.0 版本 ]
index:1543 Uncaught ReferenceError: Swiper is not defined
页面是遍历出来很多数据,一个遍历里面是一个轮播图,现在的问题是轮播图不能播放了,请问一下是什么问题呢?
代码如下:
<?php if (!empty($data['data'])): ?>
<?php foreach ($data['data'] as $list): ?>
<!--end---->
<div class="list_box_show">
<div class="swap2">
<div class="swap3">
<div class="swap4">
<span style="display: inline-block;"><?= $list['warehouse'] ?></span><span class="tuihuohuanbiao_a" >退货换标</span>
</div>
<div class="swap5">
面积:<?= $list['area'] ?>平米
</div>
</div>
<div class="swap6">
<div class="swap7">
国家:<span style="color:#FC9D27"><?= $data['country_arr'][$list['country']] ?></span>
</div>
<div class="swap8">
大货:<?php if($list['warehouse_max_weight'] == 1): ?>支持<?php else: ?>不支持<?php endif; ?>
</div>
</div>
<div class="swap9">
<div class="swap10" >
咨询:<span style="color:#FC9D27">
<a target="_blank" class="qq_a" data-id="<?= $list['qq'] ?>" data-qq=<?= $list['qq'] ?> href="http://wpa.qq.com/msgrd?v=3&uin=<?= $list['qq'] ?>&site=kuajingyan.com&menu=yes" ><img src="/img/swap/qq21.png" style="width: 15px;margin-top:-3px;margin-right: 4px;" />QQ交谈</a>
</span>
</div>
<div class="swap11">
订单处理量/日:<?= $list['warehouse_daily_order'] ?>单
</div>
</div>
<div class="swap12">
<div class="swap13">
<div class="show_price swap14">查看报价</div>
<a href="/swap/order?id=<?= $list['swap_id'] ?>"><div class="swap15">下单</div></a>
</div>
</div>
</div>
<div style="clear: both;"></div>
<div class="warehouse_jianjie swap16" style="display: block;">
<div class="swap17">
<img src="/img/swap/jianjie.png" style="width: 20px;margin-top:-3px;margin-right: 4px;margin-left: 5px;" /><?= $list['warehouse'] ?>简介
</div>
<div class="baike-banner">
<div class="banner-content clearfix" style="border:0px solid;">
<div class="content-left">
<!-- swiper -->
<div class="swiper-out">
<div class="swiper-container<?= $list['swap_id'] ?> swiper-container-horizontal">
<div class="swiper-wrapper" style="transform: translate3d(-612px, 0px, 0px); transition-duration: 0ms;">
<div class="swiper-slide" style="width: 190px;" >
<img src="http://img.kuajingyan.com/uploadImg/home/article/20190420/1555757117759746.jpg" alt="" width="100%" height="176">
</div>
<?php if (!empty($list['warehouse_picture'])): ?>
<?php foreach ($list['warehouse_picture'] as $k => $v): ?>
<div class="swiper-slide" style="width: 190px;" >
<img class="lunbo_img" data-toggle="modal" data-target="#myModal" data-swapid="<?= $list['swap_id'] ?>" src="<?= $v['wp_path'] ?>" data-id="<?= $k ?>" data-src="<?= $v['wp_path'] ?>" alt="" width="100%" height="176">
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<div class="swiper-button-next">
<img src="/img/swap/right.png" style="width: 30px;"/>
</div>
<div class="swiper-button-prev">
<img src="/img/swap/left.png" style="width: 30px;"/>
</div>
</div>
</div>
</div>
</div>
<script>
//页面层
var swiper = new Swiper('.swiper-container<?= $list['swap_id'] ?>', {
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev',
simulateTouch : false,
slidesPerView: 4,
spaceBetween: 20
});
</script>
<!----->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body"><div id="myCarousel<?= $list['swap_id'] ?>" class="carousel slide" style="height: 100%;width: 100%;display: block;">
<!-- 轮播(Carousel)指标 -->
<ol class="carousel-indicators">
<?php if (!empty($list['warehouse_picture'])): ?>
<?php foreach ($list['warehouse_picture'] as $k => $v): ?>
<li data-target="#myCarousel<?= $list['swap_id'] ?>" data-slide-to="<?= $k ?>" <?php if($k == 1): ?> class="active" <?php endif; ?>></li>
<?php endforeach; ?>
<?php endif; ?>
</ol>
<!-- 轮播(Carousel)项目 -->
<div class="carousel-inner">
<?php if (!empty($list['warehouse_picture'])): ?>
<?php foreach ($list['warehouse_picture'] as $k => $v): ?>
<div class="item <?php if($k == 1): ?> active <?php endif; ?>">
<img src="<?= $v['wp_path'] ?>" alt="First slide" style="width:100%;height:500px">
<div class="carousel-caption"><?= $list['warehouse'] ?></div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
<!-- 轮播(Carousel)导航 -->
<a class="left carousel-control" href="#myCarousel<?= $list['swap_id'] ?>" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"><img src="/img/swap/left.png" style="width:70px;"/></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#myCarousel<?= $list['swap_id'] ?>" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" ><img src="/img/swap/right.png" style="width:70px;"/></span>
<span class="sr-only">Next</span>
</a>
</div></div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!----->
<div class="swap_desc">
<?= $list['desc'] ?>
</div>
<div class="swap_baojia" >
<img src="/img/swap/baojia.png" style="width: 20px;margin-top:-3px;margin-right: 4px;margin-left: 5px;" /><?= $list['warehouse'] ?>报价
</div>
<div style="clear: both;"></div>
<div class="baojia_img">
<img src="<?= $list['price_thumb'] ?>" style="width: 100%;"/>
</div>
<div style="clear: both;"></div>
<div class="zixun_div">
<div class="zixun_div1">
<div class="zixun_qq"><img src="/img/swap/qq6.png" style="width: 15px;margin-top:-3px;margin-right: 4px;" /><a target="_blank" style="color:#FC9D27;" data-id="<?= $list['qq'] ?>" data-qq=<?= $list['qq'] ?> href="http://wpa.qq.com/msgrd?v=3&uin=<?= $list['qq'] ?>&site=kuajingyan.com&menu=yes" >QQ咨询</a></div>
<div class="zixun_xiadan"><a style="color:#fff;" href="/swap/order?id=<?= $list['swap_id'] ?>"><img src="/img/swap/wodetubiao.png" style="width: 15px;margin-top:-3px;margin-right: 4px;" />下单</a></div>
</div>
<div class="shouqi_div">
<div class="shouqi_text_div1 retract">收起<img src="/img/swap/shangjiantou.png" style="width: 20px;margin-top:-3px;margin-right: 4px;margin-left: 5px;" /></div>
</div>
</div>
<div style="clear: both;"></div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
共 0 个回答
没有找到数据。
PHP学院的中学生
注册时间:2018-10-23
最后登录:2024-09-23
在线时长:168小时13分
最后登录:2024-09-23
在线时长:168小时13分
- 粉丝29
- 金钱4725
- 威望30
- 积分6705