侧边弹出案例

刘德胜 478次浏览

摘要:<!DOCTYPEhtml> <html> <head> <metacharset="utf-8"> <title>系统首页</title> <metaname="renderer"...

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>系统首页</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="public/layui/css/layui.css" media="all">  
  <style>
  /* 右侧面板 */
  .layui-anim{display: inline-block;}
  .layui-layer-adminRight{top: 0px !important; bottom: 0; box-shadow: 1px 1px 10px rgba(0,0,0,.1); border-radius: 0; overflow: auto;}
  .layui-anim-lr{-webkit-animation-name: layui-lr; animation-name: layui-lr;}
  .layui-anim-rl.layer-anim-close{-webkit-animation-name: layui-lr; animation-name: layui-lr;}
  /* 动画 */
  @-webkit-keyframes layui-rl{ /* 从右往左滑入 */
    from {-webkit-transform: translate3d(100%, 0, 0);}
    to {-webkit-transform: translate3d(0, 0, 0);}
  }
  @keyframes layui-rl{
    from {transform: translate3d(100%, 0, 0);}
    to {transform: translate3d(0, 0, 0);}
  }
  .layui-anim-rl{-webkit-animation-name: layui-rl; animation-name: layui-rl;}
  @-webkit-keyframes layui-lr{ /* 从右往左滑入 */
    from {-webkit-transform: translate3d(0 0, 0); opacity: 1;}
    to {-webkit-transform: translate3d(100%, 0, 0); opacity: 1;}
  }
  @keyframes layui-lr{
    from {transform: translate3d(0, 0, 0);}
    to {transform: translate3d(100%, 0, 0);}
  }
  </style>
  <script src="public/js/jquery.min.js" charset="utf-8"></script>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-card">
          <div class="layui-card-header">版本信息</div>
          <div class="layui-card-body layui-text">
            <table class="layui-table">
              <colgroup>
                <col width="180">
                <col>
              </colgroup>
              <tbody> 
                <tr>
                  <th>text</th>
                  <td><button  class="layui-btn layui-btn-primary" onclick="funtext('版本信息')">text</button></td>
                </tr>                          
              </tbody>
            </table>
          </div>
        </div>      
    </div>
</body>
<script src="public/layui/layui.js"></script>
<script>
layui.use('layer', function(){
  var layer = layui.layer;
});

function funtext(s){
  layer.open({
    type: 2
    ,anim: -1
    ,title: false
    ,closeBtn: false
    ,offset: 'r'
    ,shade: 0.1
    ,shadeClose: true
    ,skin: 'layui-anim layui-anim-rl layui-layer-adminRight'
    ,area: '500px',
    content: 'http://www.baidu.com' //数组第二项即吸附元素选择器或者DOM
  });    
}
</script>
</html>