zoukankan      html  css  js  c++  java
  • 后台数据库取值 轮播图

    <div>
        <div id="myCarousel" class="carousel slide">
            <!-- 轮播(Carousel)指标 -->
            <ol class="carousel-indicators" style="bottom: 0;">
                <c:forEach items="${advertList}" var="advert" varStatus="advert1">
                    <c:if test="${advert1.index == 0}">
                        <li data-target="#myCarousel" data-slide-to="${advert1.index}" class="active"></li>
                    </c:if>
                    <c:if test="${advert1.index != 0}">
                        <li data-target="#myCarousel" data-slide-to="${advert1.index}"></li>
                    </c:if>
                </c:forEach>
            </ol>
            <!-- 轮播(Carousel)项目 -->
            <div class="carousel-inner">
                <c:forEach items="${advertList}" var="advert" varStatus="advert1">
                    <c:if test="${advert1.index == 0}">
                        <div class="item active">
                            <img style=" 100%;height: 350px" src="${advert.image}" alt="First slide">
                        </div>
                    </c:if>
                    <c:if test="${advert1.index != 0}">
                        <div class="item">
                            <img style=" 100%;height: 350px" src="${advert.image}" alt="Second slide">
                        </div>
                    </c:if>
                </c:forEach>
            </div>
            <!-- 轮播(Carousel)导航 -->
            <a class="carousel-control left" href="#myCarousel"
               data-slide="prev">&lsaquo;
            </a>
            <a class="carousel-control right" href="#myCarousel"
               data-slide="next">&rsaquo;
            </a>
        </div>
    </div>

    控制器

    @RequestMapping(value = "homepage")
        public String homepage(Model model) {
            // 获取广告对象
            List<CmsAdvert> advertList = cmsAdvertService.findList(new CmsAdvert());
            model.addAttribute("advertList", advertList);
            return "modules/cms/show/homepage";
        }
  • 相关阅读:
    基础GIT命令
    初始继承和多态。
    Servlet随笔
    初识springboot
    HBase JavaAPI
    HBase安装
    使用Eclipse来操作HDFS的文件
    hadoop常用命令
    Eclipse集成Hadoop插件
    Hadoop集群测试wordcount程序
  • 原文地址:https://www.cnblogs.com/Liang-Haishan216/p/7040933.html
Copyright © 2011-2022 走看看