网页菜单中的滑动效果

时间:2018-11-14 10:56:27

标签: javascript jquery html css bootstrap-4

嗨,我正在尝试在网页中实现滑动效果。当用户滑动圆圈图标时,然后用大圆圈突出显示当前菜单。

以下是我的代码。其实我已经尝试过owlCarousel jquery。 我从stackoverflow link

获得了参考

我需要这种类型的输出

enter image description here

var $owl = $('#owl-one');

  $owl.children().each( function( index ) {
   $(this).attr( 'data-position', index );
  });

  $owl.owlCarousel({
   center: true,
   loop: true,
   items: 10
  });

   $(document).on('click', '.owl-item>div', function(event) {

   $owl.trigger('to.owl.carousel', $(this).data( 'position' ) );

  }); 
.footer-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #334451;
    height: 57px;
    padding: 10px 0;
 z-index: 100;
}

.footer-menu .owl-carousel {
    max-width: 765px;
    margin: 0 auto;
    width: 100%;
}

.footer-menu .menu-item {
    background: #587489;
    color: #fff;
    text-align: center;
    font-family: 'ClearSans-Bold';
    font-size: 18px;
    height: 35px;
    width: 35px;
    line-height: 20px;
    padding: 5px;
    text-indent: -9999px;
    border-radius: 50%;
}
.menu-item .btn {
 padding: 0 !important;
}
.footer-menu .owl-item {

}
.menu-item .btn:hover, .menu-item .btn:active, .menu-item .btn:focus {
 box-shadow: none;
}

.footer-menu .owl-item.active .menu-item {
    border-radius: 50%;
    width: 35px;
    height: 35px;
    margin: 0 auto;
}

.footer-menu .owl-item.active.center {
    width: 110px !important;
}

.footer-menu .owl-item.active.center .menu-item {
    border-radius: 30px;
    text-indent: 0;
    width: 110px !important;
}

.footer-menu .owl-item>div {
    cursor: pointer;
    transition: margin 0.4s ease;
}

.footer-menu .owl-item.center>div {
    cursor: auto;
    margin: 0;
}

.footer-menu .owl-item:not(.center)>div:hover {
    opacity: .75;
}
<div class="footer-menu">
<div class="owl-carousel" id="owl-one">
  <div class="menu-item" title="what if?"><a class="btn links">what if?</a></div>
  <div class="menu-item" title="info"><a class="btn links">info</a></div>
  <div class="menu-item" title="how to"><a class="btn links" >how to</a></div>
  <div class="menu-item" title="true story"><a class="btn links">true story</a></div>
  <div class="menu-item" title="model"><a class="btn links" >model</a></div>
  <div class="menu-item" title="brain"><a  class="btn links">brain</a></div>
  <div class="menu-item" title="apply it"><a class="btn links">apply it</a></div>
  <div class="menu-item" title="profile"><a class="btn links">profile</a></div>
  <div class="menu-item" title="got it 1"><a class="btn links" >got it 1</a></div>
  <div class="menu-item" title="got it 2"><a class="btn links">got it 2</a></div>
</div>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/assets/owl.carousel.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/owl.carousel.min.js"></script>

我有这种类型的电流输出 enter image description here

0 个答案:

没有答案