爱番番/百度商桥-当前页面弹窗展示demo

爱番番,百度商桥改名之后的产物。

百度商桥不细说了,自己去网站配置拿到自己的商桥链接(类似这样的):https:  //p.qiao.baidu.com/cps5/chat?siteId=11111&userId=222223&siteToken=3333333&bid=444444&ctype=0&fromType=-1&tid=-1

至于怎么在当前页面弹窗展示?iframe嵌套。

理论就是通过修改弹窗样式,用iframe将爱番番 页面套进去。

以下为实例demo~~~

​
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <title>百度商桥当前页面 弹窗展示demo</title>
    <style>
    </style>
</head>
<body>
    <div class="right_nav_list">
        <!--右侧商桥-->
        <div class="right_menu left_menu02 cf">
            <div class=""></div>
            <div class="menu_ly menu_ly_click cf" style="border-top-left-radius: 1.3rem;border-top-right-radius: 1.3rem;">
                <a href="javascript:;" class="shangqiao">
                    <img src="" alt="1">
                </a>
            </div>
        </div>
        <!-- 底部商桥iframe start -->
    <div style="width: 452px;" class="iframe_shangqiao"> 
        <ins class="nb-frame-box-title" id="nbwlStatusBar" style="background: rgb(102, 150, 255);width: 100%;">
            <ins id="nbwlToggle" class="nb-webim-light-status-bar-toggle">
                <div class="nb-webim-light-toggle-icon"></div>
            </ins>
            <ins id="nbwlToggle" class="nb-webim-light-status-bar-toggle1">
                <div class="nb-webim-light-toggle-icon1"></div>
            </ins>
            <ins class="nb-webim-light-status-bar-title">在线咨询</ins>
        </ins>
        <iframe src="https://p.qiao.baidu.com/cps5/chat?siteId=11111&userId=222223&siteToken=3333333&bid=444444&ctype=0&fromType=-1&tid=-1" 
            frameborder="0" id="nb_icon_wrap" style="width: 452px;height: 425px;box-shadow: 0 8px 40px rgb(0 0 0 / 40%);border-radius: 0 0 8px 8px;overflow: hidden;">
            
        </iframe>
    </div>
    
</body>
</html>

​

css样式:

/*右侧悬浮nav*/
        .right_menu {
            position: fixed;
            right: 1.54rem;
        	top:10.9rem;
            z-index: 999;
            width: 70px;
        }
        .right_menu02 {
        	bottom: auto;top: 45%;
        }
        .right_menu02 a{
        	cursor: pointer;
        }
        .right_menu .menu_ly{
        	width: 45px;
            height:60px;
            background: #fff;
            position: relative;
            text-align: center;
            float: right;
            transition: all 0.3s;
            cursor: pointer;
            /* margin-top: 2px; */
            opacity: 0.9;
            padding: 0 .05rem;
        }
        .right_menu .menu_ly a {
            display: block;
            width: 100%;
            height: 100%;
        	border-bottom: 1px dashed #e0e0e0;
        }
        .right_menu .menu_ly:last-child a {
            border-bottom: none;
        }
        .right_menu .menu_ly a img {
            width: 1.24rem;
            height: 1.08rem;
            margin-top: 20px;
            transition: all 0.5s;
        }
        .right_menu .menu_ly a p {
            color: #fff;
            font-size: 0.16rem;
            opacity: 1;
            transition: all 0.5s;
            margin-top: 3px;
        }
        .right_menu .menu_ly:hover{width: 45px;height: 60px;}
        /* .right_menu .menu_ly:first-child:hover{margin:-20px 0 0 -20px;} */
        .right_menu .menu_ly:hover a img{margin-top: 15px;}
        .right_menu .menu_ly:hover p{opacity: 1;}
        #LXB_CONTAINER .lxb-cb-info-tip{
            display: none!important;
        }
        #LXB_CONTAINER .lxb-cb-loading-tip{
        	display: none!important;
        }
        /*百度商桥*/
        /*#nb_icon_wrap {
            height: 9.5% !important;
            width: 16.5% !important;
        }*/

        #newBridge .nb-icon-right-center {
            top: 35% !important;
        }

        #newBridge .nb-icon-wrap-base {
            height: 0px !important;
        }
          #newBridge .icon-right-center{
              display: none!important;
          }
          #LXB_CONTAINER .lxb-container-1001-2{
              height: 0px!important;
          }
          #LXB_CONTAINER .lxb-container-1001-2 .lxb-cb-input{
              display: none;
          }
          #LXB_CONTAINER .lxb-container-1001-2 .lxb-cb-input-btn{
              height: 0px!important;
          }
          #LXB_CONTAINER .lxb-container-btn-hide{
              display: none;
          }
          .t_w_text div.p{
              margin-top: 1rem;
          }


        /* 底部商桥iframe start */
        .iframe_shangqiao{
            position: fixed;
            right: 30px;
            bottom: 10px;
            z-index: 10000;
        }
        ins{
            text-decoration: none;
        }
        .nb-frame-box-title{
            display: block;
            height: 46px;
            line-height: 46px;
            border-radius: 8px 8px 0 0;
        }
        .nb-webim-light-status-bar-title{
            height: 46px;
            line-height: 46px;
            font-size: 14px;
            padding-left: 12px;
            float: left;
            _display: inline;
            color: #fff;
        }
        .nb-webim-light-status-bar-toggle{
            width: 40px;
            height: 46px;
            float: right;
            _display: inline;
            font-size: 0;
            line-height: 0;
            cursor: pointer;
        }
        .nb-webim-light-toggle-icon {
            margin-top: 24px;
            margin-left: 12px;
            width: 14px;
            border-top: solid 2px #fff;
        }
        .nb-webim-light-toggle-icon1{
            display: none;
            font-size: 0;
            margin-top: 18px;
            margin-left: 12px;
            width: 14px;
            height: 11px;
            border: solid 2px #fff;
        }
        /* 底部商桥iframe end */

JS代码:

<script>
        $(".menu_ly_click").click(function(){
            $("#nb_icon_wrap").show()
            $(".nb-webim-light-status-bar-toggle").show()
            $(".nb-webim-light-status-bar-toggle1").hide()
            $(".nb-frame-box-title").css("border-radius", "8px 8px 0 0")
        })
        $(".nb-webim-light-status-bar-toggle").click(function(){
            $(this).hide()
            $(".nb-webim-light-status-bar-toggle1").show()
            $("#nb_icon_wrap").hide()
            $(".nb-frame-box-title").css("border-radius", "8px 8px 8px 8px")
        })
        $(".nb-webim-light-status-bar-toggle1").click(function(){
            $(this).hide()
            $(".nb-webim-light-status-bar-toggle").show()
            $("#nb_icon_wrap").show()
            $(".nb-frame-box-title").css("border-radius", "8px 8px 0 0")
        })
    </script>
    <!-- 底部商桥iframe end -->

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值