为了账号安全,请及时绑定邮箱和手机立即绑定

owlCarousel 旋转

标签:
JavaScript




<div class="tab_container">
    <div class="tab_content_category_tabs_3">
        <div class="row">
            <div class="col-xs-12 col-md-12 xs-offset-0">
                <div id="owl-demo" class="owl-carousel ">
                    <c:if test="${not empty banners_c.advertisement}">
                        <c:forEach items="${banners_c.advertisement}" var="banners_c">
                            <div class="item">
                                <a href="${banners_c.hrefUrl}" title="Read more">
                                    <img class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="${imageHost}${banners_c.imageUrl}" alt="Owl Image">
                                </a>
                            </div>
                        </c:forEach>
                    </c:if>
                </div>
            </div>
        </div>
    </div>
</div>






<content tag="myJavascript">

    <script type="text/javascript">
        
        jQuery().ready(function () {
          
            $("#owl-demo").owlCarousel({
                autoPlay: false,
                items: 3,
                itemsDesktop: [1199, 3],
                itemsDesktopSmall: [980, 3],
                itemsTablet: [768, 2],
                itemsMobile: [480, 1],
                slideSpeed: 1000,
                paginationSpeed: 1000,
                rewindSpeed: 1000,
                navigationText: ["", ""],
                navigation: true,
                stopOnHover: true,
                pagination: true
            });
        });
    </script>
</content>



1、引入文件

<link href="css/owl.carousel.css" rel="stylesheet"><link href="css/owl.theme.css" rel="stylesheet"><script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="js/jquery.min.js"></script><script class="lazyload" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC" data-original="js/owl.carousel.js"></script>

2、HTML

<div id="owl-demo" class="owl-carousel">    <div>1</div>    <div>2</div>    <div>3</div>    <div>4</div>    <div>5</div>    <div>6</div>    <div>7</div>    <div>8</div></div>

3、JavaScript

$(function(){    $('#owl-example').owlCarousel();});



格式就是div 里面 嵌套一个div


点击查看更多内容
TA 点赞

若觉得本文不错,就分享一下吧!

评论

作者其他优质文章

正在加载中
  • 推荐
  • 评论
  • 收藏
  • 共同学习,写下你的评论
感谢您的支持,我会继续努力的~
扫码打赏,你说多少就多少
赞赏金额会直接到老师账户
支付方式
打开微信扫一扫,即可进行扫码打赏哦
今天注册有机会得

100积分直接送

付费专栏免费学

大额优惠券免费领

立即参与 放弃机会
意见反馈 帮助中心 APP下载
官方微信

举报

0/150
提交
取消