您当前的位置: 首页 >  css

漏刻有时

暂无认证

  • 0浏览

    0关注

    717博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

百度地图高级开发:上滑推拉菜单CSS解决方案

漏刻有时 发布时间:2021-12-15 10:15:57 ,浏览量:0

在这里插入图片描述

CSS样式表
        html, body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
        }

        #lock_map {
            width: 100%;
            height: 100%;
        }

        .panel {
            position: fixed;
            width: 94%;
            height: 400px;
            border-radius: 20px 20px 0 0;
            padding: 10px;
            left: 0;
            right: 0;
            bottom: -350px; /*底部露出的距离*/
            margin: 0 auto;
            transition: bottom 1s ease; /*推拉动画*/
            background-color: rgba(255, 255, 255, 1);
        }
HTML容器

LockDataV
菜单事件
    var btnStatus = 1;
    $('.panel').click(() => {
        if (btnStatus == 1) {
            btnStatus = 0;
            $('.panel')[0].style.cssText = 'bottom: 0rem;'
        } else {
            btnStatus = 1;
            $('.panel')[0].style.cssText = 'bottom: -350px;'
        }
    });
初始化地图
    var map = new BMap.Map("lock_map");
    var point = new BMap.Point(117.016415, 36.619618);
    map.centerAndZoom(point, 12);
    map.enableScrollWheelZoom(true);

@lockdata.cn

关注
打赏
1661217259
查看更多评论
立即登录/注册

微信扫码登录

0.0375s