<?php if($banners){?>
<div class="ms-controller" ms-controller="bannerShow">
<div id="owl-demo" class="page-banner owl-carousel owl-theme">
<a class="item" ms-for="el in @bannerData">
<img ms-attr="{src:el.image}" alt="" style="width:100%;height: 382px;" ms-click="toLink(el.link)">
</a>
</div>
<div class="modal fade" id="showTryPic" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" style="cursor: pointer;">
<div class="modal-dialog" role="document" style="width: 441px;height:520px;">
<div class="modal-content" style="width: 441px;height: 520px;">
<div class="modal-body" style="width:441px;height:520px;box-sizing: border-box;background-color: #f5f5f9;padding:0;border-radius: 5px;position: relative;text-align: center;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="width:20px;height:20px;display:inline-block;background:url(/image/system/modal-img/cn_img/close.png) no-repeat center center;background-size: contain;position: absolute;right:10px;top:10px;z-index: 1;"
onClick="javascript:;">
<span aria-hidden="true" id="guan"></span>
</button> <div class="tryscan">
<div id="bannerCode"></div>
</div>
</div>
</div>
</div>
</div>
</div> <script type="text/javascript">
// var bannerlist = <?php echo json_encode($banners); ?>;
var qrcodeBanner = new QRCode(document.getElementById("bannerCode"), {
width: 120,
height: 120
});
// setTimeout(function () { // }, 1000);
</script> <script>
var banner = avalon.define({
$id: "bannerShow",
bannerData: <?php echo json_encode($banners); ?>,
langModalHeader: function () {
$("#showTryPic").modal("show");
banner.geturl('https://try.fishqc.com')
},
geturl: function (url) {
banner.str = url;
qrcodeBanner.makeCode(banner.str);
},
toLink: function (item) {
if (item == "1") {
banner.langModalHeader()
} else {
window.location.href = item
} }
})
banner.$watch('onReady', function () {
if (this.bannerData) {
$('#owl-demo').owlCarousel({
items: 1,
loop: true,
lazyLoad: true,
autoplay: true,
autoplayTimeout: 5000,
nav: true,
navText: ['<i class="fa fa-angle-left"></i>', '<i class="fa fa-angle-right"></i>']
});
}
})
</script>
<style type="text/css">
.page-banner a.img {
display: block;
background-size: auto 100%;
} #bannerCode {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-49%, -48%);
}
</style>
<?php }?>

  因为数据还没有出来不能直接调轮播图,所以先判断数据有没有出来先

而且图片的路径里面不能带中文,空格

最新文章

  1. 2016-11-05实战-定义ssh服务的日志
  2. 总结Oracle删除表空间遇到的问题
  3. go并发3
  4. [nginx] connect() failed (111: Connection refused) while connecting to upstream, client: 101.18.123.107, server: localhost,
  5. COGS 577 蝗灾
  6. PHP回调函数的几种用法
  7. WPF中利用后台代码实现窗口分栏动态改变
  8. July收集荷兰国旗问题之三路partition
  9. 图像处理库的比较:OpenCV,FreeImage,CImg,CxImage
  10. (Problem 35)Circular primes
  11. 进度条(ProgressBar)的功能与用法
  12. mac抓包工具anyproxy
  13. 移动端bug集合
  14. spring-boot-2.0.3之quartz集成,数据源问题,源码探究
  15. 一、VS2017支持Github
  16. 一种表达式语言的解析引擎JEXL简单使用
  17. CSS外观属性
  18. git杂记:忽略ssl认证
  19. 尚硅谷面试第一季-09SpringMVC中如何解决POST请求中文乱码问题GET的又如何处理呢
  20. BaseDao 接口

热门文章

  1. elasticsearch 开机自启
  2. TCP粘包/拆包(Netty权威指南)
  3. iOS音频学习笔记二:iOS SDK中与音频有关的相关框架
  4. jmeter安装,汉化
  5. 【SpringMVC】参数绑定
  6. Mysql语句练习记录
  7. dubbo API的使用方式
  8. 【OF框架】搭建标准工作环境
  9. CentOS7下编译安装Python3.7.x【亲测有效】
  10. JDBC课程1-实现Driver接口连接mysql数据库、通用的数据库连接方法(使用文件jdbc.properties)