【js+css实现右边侧栏抽屉功能效果】

本文介绍了如何使用JavaScript和CSS创建右侧抽屉效果,提供了一个管理系统后台的右侧弹窗特效。通过点击按钮,可以显示或隐藏右侧的内容页面,支持URL链接和HTML内容。示例代码包括HTML、CSS和JS部分,提供了rightWindows函数的调用方法和参数说明。
摘要由CSDN通过智能技术生成

js实现右侧抽屉效果,点击实现右侧弹出内容页面特效,点击空白遮罩处或关闭按钮可以隐藏弹出的页面。

下面我们来看下本实例具体的演示效果:

js+css实现右侧边栏抽屉功能效果icon-default.png?t=M4ADhttps://download.csdn.net/download/heronivy/85558284

某管理系统后台整合效果:

 

 html部分实现代码

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>js右侧抽屉特效,右侧弹窗特效</title>
    <link rel="stylesheet" href="static/css/style.css" media="all" />
    <link rel="stylesheet" href="static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <style type="text/css">
        .test-btn {
            display: inline-block;
            height: 38px;
            line-height: 38px;
            border: 1px solid transparent;
            padding: 0 18px;
            background-color: #009688;
            color: #fff;
            white-space: nowrap;
            text-align: center;
            font-size: 14px;
            border-radius: 2px;
            cursor: pointer;
        }
        .bgreg{
            background-color:#FF0000;
        }

    </style>
    <script type="text/javascript" src="static/lib/jquery/jquery.js"></script>
    <script type="text/javascript" src="static/js/public.js?20220605"></script>
</head>
<body>
<a id="btn" onclick="btns();" class="test-btn">右侧抽屉特效(url)</a>
<a id="btn2" onclick="btns2();" class="test-btn bgreg">右侧抽屉特效(html内容)</a>

<br>请点击上面按钮
<script>
    //效果1
    function btns() {
        var urls='https://blog.csdn.net/heronivy';
        rightWindows('右侧内容特效',urls,true);
    }

    //效果2
    function btns2() {
        var urls='<a href="https://blog.csdn.net/heronivy" target="_blank">https://blog.csdn.net/heronivy</a>';
        rightWindows('右侧内容特效',urls,false);
    }

</script>
</body>
</html>

使用帮助: 调用函数 rightWindows(title, content, isIframe);

参数说明:

* @param {string} title

* @param {string} content 如果isIframe=true,则为url地址

* @param {bool} isIframe

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

heronivy

你的鼓励将是我创创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值