ITPub博客

首页 > IT职业 > IT图书 > 关于分辨率缩小时,list-group隐藏为按钮的问题解决方法

关于分辨率缩小时,list-group隐藏为按钮的问题解决方法

IT图书 作者:keehoo 时间:2021-09-09 09:00:15 0 删除 编辑

图片描述

图片描述

图片描述

查看了例子中的源码,有个offcanvas.css和offcanvas.js需要加载。
offcanvas.css的源码:

/*
 * Style tweaks
 * --------------------------------------------------
 */
/*html,
body {
  overflow-x: hidden;  Prevent scroll on narrow devices 
}
body {
  padding-top: 70px;
}
footer {
  padding: 30px 0;
}*/
/*
 * Off Canvas
 * --------------------------------------------------
 */
@media screen and (max-width: 767px) {
  .row-offcanvas {
    position: relative;
    -webkit-transition: all .25s ease-out;
         -o-transition: all .25s ease-out;
            transition: all .25s ease-out;
  }
  .row-offcanvas-right {
    right: 0;
  }
  .row-offcanvas-left {
    left: 0;
  }
  .row-offcanvas-right
  .sidebar-offcanvas {
    right: -50%; /* 6 columns */
  }
  .row-offcanvas-left
  .sidebar-offcanvas {
    left: -50%; /* 6 columns */
  }
  .row-offcanvas-right.active {
    right: 50%; /* 6 columns */
  }
  .row-offcanvas-left.active {
    left: 50%; /* 6 columns */
  }
  .sidebar-offcanvas {
    position: absolute;
    top: 0;
    width: 50%; /* 6 columns */
  }
}

offcanvas.js的源码:

$(document).ready(function () {
  $('[data-toggle="offcanvas"]').click(function () {
    $('.row-offcanvas').toggleClass('active')
  });
});

在 .html代码中加载这两个文件,样式和行为才能起效。
两个代码片段中对offcanvas的引用,button调用了data-toggle方法:

下面是list-group需要加载的样式

 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4357/viewspace-2807620/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-12

  • 博文量
    0
  • 访问量
    632