zoukankan      html  css  js  c++  java
  • 侧面板panel

    实例:

    <!-- Panels overlay-->
    <div class="panel-overlay"></div>
    <!-- 左侧面板 -->
    <div class="panel panel-left panel-reveal">
        <div class="content-block">
            <p><a href="#" class="close-panel">关闭面板</a></p>
        </div>
    </div>
    <!-- 右侧面板 -->
    <div class="panel panel-right panel-cover">
        <div class="content-block">
            <p><a href="#" class="close-panel" data-panel="right">关闭面板</a></p>
        </div>
    </div>

    左侧面板:panel-left

    右侧面板:panel-right

    推出面板:panel-reveal

    覆盖:panel-cover

    关闭面板:close-panel

    方法:myApp.openPanel('left[right]')

    事件:

    var myApp = new Framework7();

    var $$ = Dom7;

    $$('.panel-left').on('opened', function () { myApp.alert('Left panel opened!'); });

    滑动推出面板需要配置初始化参数,但只能设置一边:swipePanel: 'left[right]'

    判断侧边栏是否打开:

    • 如果你有带Cover效果的左侧栏打开着,body会有“with-panel-left-cover”类 <body class="with-panel-left-cover">

    • 如果你有带Reveal效果的左侧栏打开着, body 会有“with-panel-left-reveal”类 <body class="with-panel-left-reveal">

    • 如果你有带Cover效果的右侧栏打开着,body会有"with-panel-right-cover" 类 <body class="with-panel-right-cover">

    • 如果你有带Reveal效果的右侧栏打开着, body 会有"with-panel-right-reveal" 类 <body class="with-panel-right-reveal">

    判断if ($$('body').hasClass('with-panel-left-cover')) { console.log('Left Panel is opened') }

  • 相关阅读:
    团队项目第二阶段冲刺第六天
    团队项目冲刺第二阶段第五天
    团队项目冲刺第二阶段第四天
    团队项目冲刺第二阶段第三天
    大道至简阅读笔记1
    团队项目冲刺第二阶段第二天
    团队项目第二阶段冲刺第一天
    团队项目冲刺第九天
    团队项目冲刺第八天
    团队项目冲刺第七天
  • 原文地址:https://www.cnblogs.com/zhenxianluo/p/framework7.html
Copyright © 2011-2022 走看看