百度商桥的离线宝弹窗等代码

离线宝html代码

     <form target="aa">
                    <input class="doc-tele ty-right-zx-tele-call" id="call_tel" name="tel" type="text">
                    <input value="回电" class="doc-submit ty-right-zx-tele-call" id="call_sub" type="submit">
                </form>

离线宝脚本代码,如果https网站 请修改为https

<script type="text/javascript">
//离线宝回电
(function() {
    var h = document.getElementsByTagName('head')[0];
    var u = document.createElement('script');
    u.type = 'text/javascript';
    u.setAttribute('data-lxb-uid', '24663790');
    u.setAttribute('async', '');
    u.src = 'https://lxbjs.baidu.com/api/asset/api.js?t=' + Date.parse(new Date());
    h.appendChild(u);
    try {
        document.getElementById('call_subs').onclick = function() {
            lxb.call(document.getElementById('call_tels'));
            return false;
        }
        delete o;
    } catch (e) {
              
    };

})();
</script>

全部代码

// JavaScript Document 通用商务通离线宝弹窗


//公共弹窗

/*

document.write('<script language="javascript" src="/swt/tc.js"></script>');*/

//商务通轨迹、链接 放在所有动态加载js文件较后一个位置

document.write('<script language="javascript" src="http://pct.zoosnet.net/JS/LsJS.aspx?siteid=PCT54245569&float=1&lng=cn"></script>');

/*离线宝

document.write('<script type="text/javascript" charset="utf-8" async="" src="http://lxbjs.baidu.com/lxb.js?sid=2398560"></script>');

*/

/** 添加中间漂浮div */

;(function(){

    var o = document.createElement('div');

    o.innerHTML = ['<style>',

   '.swtCenter {width:250px;height:185px; background-color:#FFF;position:fixed;left:50%;top:50%;z-index:200;margin-left:-125px;margin-top:-130px;-moz-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-shadow:0 0 20px rgba(10,2,4,0.75);-webkit-box-shadow:0 0 20px rgba(10,2,4,0.75);box-shadow:0 0 20px rgba(10,2,4,0.75);display:none;}',

    '.swtCenter h3 {width:100%;font-size:22px;text-align:center; color:#2e3642;font-weight:500;margin-top:15px;}',

    '.swtCenter h4 {width:100%;font-size:14px;text-align:center;color:#F37B38; margin-top: 5px}',

    '.mfhd {width:227px;height:32px;border:1px solid #6a7380;-moz-border-radius:17px;-webkit-border-radius:17px;border-radius:17px;margin:5px auto 5px;}',

    '.mfhd input {border:none; width:150px;height:30px;line-height:32px; background-color:#FFF;font-size:14px;color:#6a7380;-moz-border-radius:15px 0 0 15px;-webkit-border-radius:15px 0 0 15px;border-radius:15px 0 0 15px;padding-left:13px;float:left;outline:none;-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;}',

    '.mfhd #callbF_sub {width:68px;height:32px;line-height:32px;color:#fff; background-color:#f37b38;font-size:12px;text-align:center;text-decoration:none;-moz-border-radius:0 14px 14px 0;-webkit-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0;float:right;}',

    '.swtCenter p {width:230px;font-size:12px;line-height: 20px; color:#6a7380;margin:5px auto 0;}',

    '.swt_lists {position: absolute;bottom:0;left:0;width:100%;height:35px;line-height:35px;-moz-border-radius:0 0 15px 15px;-webkit-border-radius:0 0 15px 15px;border-radius:0 0 15px 15px;}',

    '.swt_lists a {display:block;width:50%;height:100%;position:relative;float:left;}',

    '.swt_list1 { background-color:#f37b38;-moz-border-radius:0 0 0 15px;-webkit-border-radius:0 0 0 15px;border-radius:0 0 0 15px;}',

    '.swt_list2 { background-color:#018585;-moz-border-radius:0 0 15px 0;-webkit-border-radius:0 0 15px 0;border-radius:0 0 15px 0;}',

    '.swt_lists a i,.swt_lists a em {display:block;position:absolute;left:50%;color:#fff;text-decoration:none;font-style: normal;}',

    '.swtCallIcon {top:50%;margin-left:-50px;margin-top:-13px;width:27px;height:27px; background:url(/swt/footerLink3.png) no-repeat;-moz-background-size:100%;-webkit-background-size:100%;background-size:100%;}',

    '.swt_lists em {height:100%;top:0;margin-left:-16px;font-size:16px;}',

    '.swtLinkIcon {top:50%;margin-left:-50px;width:27px;height:24px;margin-top:-12px;background:url(/swt/footerLink2.png) no-repeat;-moz-background-size:100%;-webkit-background-size:100%;background-size:100%;}',

    '.swtLinkCounter {top:15px;width:14px;height:14px;margin-left:-34px;line-height:13px;text-align:center;font-size:9px;background-color:#e60012;-moz-border-radius:14px;-webkit-border-radius:14px;border-radius:14px;-moz-box-shadow:0 0 3px rgba(0,0,0,0.8);-webkit-box-shadow:0 0 3px rgba(0,0,0,0.8);box-shadow:0 0 3px rgba(0,0,0,0.8);z-index:3;font-style:normal;}',

    '.closeBtn_swt {position: absolute; left:-15px;top:-10px;width:44px;height:44px; background:url(/swt/closeBtn_swt.png) no-repeat;-moz-background-size:35px auto;-webkit-background-size:35px auto;background-size:35px auto;cursor:pointer;}',

    '</style>',

    '<div class="swtCenter relative"  id="swt" style="display: none;">',

    '   <span class="closeBtn_swt" id="close_swt"></span>',

    '   <h3>长沙医博医师在线</h3>',

    '   <h4>83.1%的人选择电话问医生</h4>',

    '   <div class="mfhd clearfix">',

    '<form target="aa">',

    '       <input type="tel" name="tel" class="callbF_text" id="callbF_text" onclick="this.value = \'\'" onblur="if(value == \'\'){value=\'请输入您的电话号码\'}" value="请输入您的电话号码" name="callbF_text">',

    '        <input type="submit" id="callbF_sub" class="callbF_sub" value="回电"/>' ,  

    '<iframe name="aa" id="aa" frameborder="0" width="0" height="0"></iframe></form>',

    '</form>',

    '    </div>',

    '    <p>',

    '        我们将立即回电。该通话<b style="color:red;font-size:16px;font-weight:bold;">对您</b>,请放心接听!手机请直接输入,座机前加区号。',

    '    </p>',

    '    <div class="swt_lists">',

    '       <a href="javascript:void(0)" onclick="openZoosUrl();" target="_blank" class="JS-SWT-LINK swt_list1" title="zjtc"><i class="swtLinkCounter" id="swtLinkCounter">7</i><i class="swtLinkIcon"></i><em>悄悄提问</em></a>',

    '        <a href="tel://073182296120"  class="swt_list2"><i class="swtCallIcon"></i><em> 拨打电话</em></a>',

    '    </div>',

   ' </div>'

    ].join('\r\n');

    while(o.firstElementChild){

        document.body.appendChild(o.firstElementChild);

    }

     setTimeout(function(){   

            var pflkt = document.getElementById('swt');              

            pflkt.style.display = "block";

        }, 10E3);

     document.getElementById('close_swt').onclick = function (){

        var pflkt = document.getElementById('swt');  

        pflkt.style.display = "none";               

        setTimeout(function(){                

            pflkt.style.display = "block";

        }, 12E3);

        return false;

    }

    var h= document.getElementsByTagName('head')[0]; 

    var s= document.createElement('script'); 

    s.type= 'text/javascript'; 

    s.setAttribute('data-lxb-uid','1902283');

    s.src= 'http://lxbjs.baidu.com/api/asset/api.js?t='+Date.parse(new Date());

    h.appendChild(s);

    document.getElementById('callbF_sub').onclick=function(){

        lxb.call(document.getElementById('callbF_text'));

        return false;

    }   

    delete o;

  



})();


相关内容

发表评论

验证码:
点击我更换图片

最新评论