[Code] banner slide owl-carousel responsive tùy chỉnh blogger

  • Admin

    banner slide owl-carousel responsive tùy chỉnh blogger


    Bản trước mình có share code banner bxslide nhưng sử dụng khá nhiều section , bản này mình sẽ cải tiến sử dụng owl-carousel để ae dễ sử dụng hơn.



    Anh em chỉ cần cho vào vị trí cần hiện là được
    Code:
     <b:section class='owl-carousel owl-theme' id='hotrofmbanner' preferred='yes'>
          <b:widget id='Image1' locked='true' title='sada' type='Image' version='1'>
            <b:widget-settings>
              <b:widget-setting name='displayUrl'>http://fsivietnam.com.vn/Storage/Files/2017/12/14/201712141342566630-ad5021e6d62379770ff2c4534ca567ea.png</b:widget-setting>
              <b:widget-setting name='displayHeight'>422</b:widget-setting>
              <b:widget-setting name='sectionWidth'>790</b:widget-setting>
              <b:widget-setting name='shrinkToFit'>false</b:widget-setting>
              <b:widget-setting name='displayWidth'>1425</b:widget-setting>
              <b:widget-setting name='link'>http://áda</b:widget-setting>
              <b:widget-setting name='caption'>ád</b:widget-setting>
            </b:widget-settings>
            <b:includable id='main'>
       
        <div class='widget-content'>
          <b:tag cond='data:link' expr:href='data:link' name='a'>
            <img expr:alt='data:title' expr:id='data:widget.instanceId + &quot;_img&quot;' expr:src='data:sourceUrl' expr:width='data:width'/>
          </b:tag>
          <br/>
       
        </div>
      </b:includable>
          </b:widget>
          <b:widget id='Image2' locked='true' title='sada' type='Image' version='1'>
            <b:widget-settings>
              <b:widget-setting name='displayUrl'>http://fsivietnam.com.vn/Storage/Files/2017/12/14/201712141342566630-ad5021e6d62379770ff2c4534ca567ea.png</b:widget-setting>
              <b:widget-setting name='displayHeight'>422</b:widget-setting>
              <b:widget-setting name='sectionWidth'>790</b:widget-setting>
              <b:widget-setting name='shrinkToFit'>false</b:widget-setting>
              <b:widget-setting name='displayWidth'>1425</b:widget-setting>
              <b:widget-setting name='link'>http://áda</b:widget-setting>
              <b:widget-setting name='caption'>ád</b:widget-setting>
            </b:widget-settings>
            <b:includable id='main'>
       
        <div class='widget-content'>
          <b:tag cond='data:link' expr:href='data:link' name='a'>
            <img expr:alt='data:title' expr:id='data:widget.instanceId + &quot;_img&quot;' expr:src='data:sourceUrl' expr:width='data:width'/>
          </b:tag>
          <br/>
       
        </div>
      </b:includable>
          </b:widget>
          <b:widget id='Image3' locked='true' title='sada' type='Image' version='1'>
            <b:widget-settings>
              <b:widget-setting name='displayUrl'>http://fsivietnam.com.vn/Storage/Files/2017/12/14/201712141342566630-ad5021e6d62379770ff2c4534ca567ea.png</b:widget-setting>
              <b:widget-setting name='displayHeight'>422</b:widget-setting>
              <b:widget-setting name='sectionWidth'>790</b:widget-setting>
              <b:widget-setting name='shrinkToFit'>false</b:widget-setting>
              <b:widget-setting name='displayWidth'>1425</b:widget-setting>
              <b:widget-setting name='link'>http://áda</b:widget-setting>
              <b:widget-setting name='caption'>ád</b:widget-setting>
            </b:widget-settings>
            <b:includable id='main'>
       
        <div class='widget-content'>
          <b:tag cond='data:link' expr:href='data:link' name='a'>
            <img expr:alt='data:title' expr:id='data:widget.instanceId + &quot;_img&quot;' expr:src='data:sourceUrl' expr:width='data:width'/>
          </b:tag>
          <br/>
       
        </div>
      </b:includable>
          </b:widget>
        </b:section>


    <script src="https://owlcarousel2.github.io/OwlCarousel2/assets/vendors/jquery.min.js"></script>
     <script src="https://owlcarousel2.github.io/OwlCarousel2/assets/owlcarousel/owl.carousel.js"></script>

    <style>
    /**
     * Owl Carousel v2.2.1
     * Copyright 2013-2017 David Deutsch
     * Licensed under  ()
     */
    .owl-theme .owl-dots,.owl-theme .owl-nav{text-align:center;-webkit-tap-highlight-color:transparent}.owl-theme .owl-nav{margin-top:10px}.owl-theme .owl-nav [class*=owl-]{color:#FFF;font-size:14px;margin:5px;padding:4px 7px;background:#D6D6D6;display:inline-block;cursor:pointer;border-radius:3px}.owl-theme .owl-nav [class*=owl-]:hover{background:#869791;color:#FFF;text-decoration:none}.owl-theme .owl-nav .disabled{opacity:.5;cursor:default}.owl-theme .owl-nav.disabled+.owl-dots{margin-top:10px}.owl-theme .owl-dots .owl-dot{display:inline-block;zoom:1}.owl-theme .owl-dots .owl-dot span{width:10px;height:10px;margin:5px 7px;background:#D6D6D6;display:block;-webkit-backface-visibility:visible;transition:opacity .2s ease;border-radius:30px}.owl-theme .owl-dots .owl-dot.active span,.owl-theme .owl-dots .owl-dot:hover span{background:#869791}
    /**
     * Owl Carousel v2.2.1
     * Copyright 2013-2017 David Deutsch
     * Licensed under  ()
     */
    .owl-carousel,.owl-carousel .owl-item{-webkit-tap-highlight-color:transparent;position:relative}.owl-carousel{display:none;width:100%;z-index:1}.owl-carousel .owl-stage{position:relative;-ms-touch-action:pan-Y;-moz-backface-visibility:hidden}.owl-carousel .owl-stage:after{content:".";display:block;clear:both;visibility:hidden;line-height:0;height:0}.owl-carousel .owl-stage-outer{position:relative;overflow:hidden;-webkit-transform:translate3d(0,0,0)}.owl-carousel .owl-item,.owl-carousel .owl-wrapper{-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0)}.owl-carousel .owl-item{min-height:1px;float:left;-webkit-backface-visibility:hidden;-webkit-touch-callout:none}.owl-carousel .owl-item img{display:block;width:100%}.owl-carousel .owl-dots.disabled,.owl-carousel .owl-nav.disabled{display:none}.no-js .owl-carousel,.owl-carousel.owl-loaded{display:block}.owl-carousel .owl-dot,.owl-carousel .owl-nav .owl-next,.owl-carousel .owl-nav .owl-prev{cursor:pointer;cursor:hand;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-loading{opacity:0;display:block}.owl-carousel.owl-hidden{opacity:0}.owl-carousel.owl-refresh .owl-item{visibility:hidden}.owl-carousel.owl-drag .owl-item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.owl-carousel.owl-grab{cursor:move;cursor:grab}.owl-carousel.owl-rtl{direction:rtl}.owl-carousel.owl-rtl .owl-item{float:right}.owl-carousel .animated{animation-duration:1s;animation-fill-mode:both}.owl-carousel .owl-animated-in{z-index:0}.owl-carousel .owl-animated-out{z-index:1}.owl-carousel .fadeOut{animation-name:fadeOut}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}.owl-height{transition:height .5s ease-in-out}.owl-carousel .owl-item .owl-lazy{opacity:0;transition:opacity .4s ease}.owl-carousel .owl-item img.owl-lazy{transform-style:preserve-3d}.owl-carousel .owl-video-wrapper{position:relative;height:100%;background:#000}.owl-carousel .owl-video-play-icon{position:absolute;height:80px;width:80px;left:50%;top:50%;margin-left:-40px;margin-top:-40px;background:url(owl.video.play.png) no-repeat;cursor:pointer;z-index:1;-webkit-backface-visibility:hidden;transition:transform .1s ease}.owl-carousel .owl-video-play-icon:hover{-ms-transform:scale(1.3,1.3);transform:scale(1.3,1.3)}.owl-carousel .owl-video-playing .owl-video-play-icon,.owl-carousel .owl-video-playing .owl-video-tn{display:none}.owl-carousel .owl-video-tn{opacity:0;height:100%;background-position:center center;background-repeat:no-repeat;background-size:contain;transition:opacity .4s ease}.owl-carousel .owl-video-frame{position:relative;z-index:1;height:100%;width:100%}
    </style>

      <script>
                $(document).ready(function() {
                  $('.owl-carousel').owlCarousel({
                    loop: true,
                    margin: 10,
                    responsiveClass: true,
                    responsive: {
                      0: {
                        items: 1,
                        nav: true
                      },
                      600: {
                        items: 1,
                        nav: false
                      },
                      1000: {
                        items: 1,
                        nav: true,
                        loop: false,
                        margin: 20
                      }
                    }
                  })
                })
              </script>

Thông tin tác giả
avatar
ACP
Bài viết :
329
Points :
636
Like :
106
Punbb
Quản trị
Status :
test
Xem lý lịch thành viên http://hotrofm.forumvi.com
Bài viết liên quan
    Đang tải dữ liệu

Permissions in this forum:
Bạn không có quyền trả lời bài viết