• 侧面板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') }

  • 相关阅读:
    C++函数四( 具有默认参数值的函数)
    C++函数三(内联函数和函数重载)
    C++函数二(函数的嵌套调用和递归调用)
    C++关于函数声明定义的位置
    C++函数一(标准库函数,自定义函数)
    C++扑克牌发牌游戏程序(包括C++随机数的解释)
    C++数组二(字符数组)
    C++数组一
    C++程序流程结构
    C++运算符与表达式
  • 原文地址:https://www.cnblogs.com/zhenxianluo/p/framework7.html
Copyright © 2020-2023  润新知