红穆笔记
首頁 › 踩坑總結 › 網站側邊客服代碼 摺疊式 圓球客服展示
踩坑總結

網站側邊客服代碼 摺疊式 圓球客服展示

网站侧边客服代码 折叠式 圆球客服展示

首先是html代碼:

<section id="cebian">
    <div class="all close">
        <div class="shang">
            <div class="mune">
                <p>Chat with us!</p>
                <a href="#"><i class="iconfont icon-weixin2"></i></a>
            </div>
            <div class="mune">
                <p>Phone</p>
                <a href="#"><i class="iconfont icon-dianhuatianchong"></i></a>
            </div>
            <div class="mune">
                <p>Email</p>
                <a href="#"><i class="iconfont icon-youxiang2"></i></a>
            </div>
            <div class="mune">
                <p>Sign up</p>
                <a href="#"><i class="iconfont icon-yonghu"></i></a>
            </div>
            <div class="mune">
                <p>Chat</p>
                <a href="#"><i class="iconfont icon-message_full"></i></a>
            </div>

            <div id="open">
                <a href="#"><i class="iconfont icon-guanbi"></i></a>
            </div>
        </div>
    </div>
</section>

然後是css代碼:

* {
    margin: 0;
    padding: 0;
}

#cebian {
    background: rgba(255, 255, 255, 0.8);
    position: fixed;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    top: 0;
}

#cebian .all {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 0 30px 30px 0;
}

#cebian .all .shang {
    display: flex;
    flex-direction: column;

}

#cebian .all .shang>div {
    display: flex;
    justify-content: flex-end;
    height: 44px;
    margin-bottom: 15px;
}

#cebian .all .shang>div>a {
    height: 44px;
    line-height: 44px;
    text-align: center;
    text-decoration: none;
    width: 44px;
    display: block;
    box-shadow: 0 2px 8px 0px rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

#cebian .all .shang>div:nth-child(1) a {
    background: #ffcb00;
}

#cebian .all .shang>div:nth-child(2) a {
    background: #63c956;
}

#cebian .all .shang>div:nth-child(3) a {
    background: #be1867;
}

#cebian .all .shang>div:nth-child(4) {
    background: #ffcb00;
    display: none;
}

#cebian .all .shang>div:nth-child(5) a {
    background: #2d41a9;
}

#cebian .all .shang>div:nth-child(6) a {
    background: #008afc;
    width: 50px;
    height: 50px;
    line-height: 50px;
}

#cebian .all .shang>div>a>.iconfont {
    color: #fff;
    font-size: 20px;
}

#cebian .all .shang>div>p {
    margin: 8px 15px;
    border: 1px solid #fff;
    padding: 6px 8px;
    color: #1d2d3c;
    line-height: 1em;
    font-size: 14px;
    border-radius: 4px;
    box-shadow: 0 0 8px #ccc;
    background: #fff;
}

#cebian .all .shang .mune {
    opacity: 0.9;
}

#cebian .all .shang .none {
    display: none;
}

.cebian {
    background: none;
    width: 0;
    height: 0;
    top: unset;
    right: 0;
    bottom: 0;
}

接下來是js代碼:

$(function () {
    var open = false;
    var first = true;
    if (first) {
        $("#open a i").addClass("icon-a-13Ashenglve");
        $("#open a i").removeClass("icon-guanbi");
        $(".mune").addClass("none");
        $("#cebian").css({ "background": "none", "width": "0", "height": "0", "top": "unset", "right": "0", "bottom": "0" });
        first = !first;
    }
    $("#cebian").click(function () {
        if (open) {
            $("#open a i").addClass("icon-a-13Ashenglve");
            $("#open a i").removeClass("icon-guanbi");
            $(".mune").addClass("none");
            $("#cebian").css({ "background": "none", "width": "0", "height": "0", "top": "unset", "right": "0", "bottom": "0" });
            open = !open;
        } else {
            $("#open a i").removeClass("icon-a-13Ashenglve");
            $("#open a i").addClass("icon-guanbi");
            $(".mune").removeClass("none");
            $("#cebian").attr("style", "");
            open = !open;
        }
    });
}); 

需要引入jQuery纔行生效!同時iconfont需要自己去引入或者查找對應的圖標

微信赞赏

微信

支付宝赞赏

支付寶

✍️ 作者: 紅穆

網站管理員 · 感謝閱讀,更多精彩內容敬請關注

作者主頁 查看主頁 →

相關文章

浏览器缓存增加你网站二次访问速度

瀏覽器緩存增加你網站二次訪問速度 踩坑總結

使用瀏覽器緩存官方話語:如果用戶會多次訪問您的網站,那麼靜態資源的瀏覽器緩存可以節省用戶的時間。緩存標頭應當應用到所有可緩存的靜態資源中,而不僅僅是應用到一小部分靜態資源(例如,圖片)中。可緩存的資源包括JS和CSS文件、圖像文件及其他二進制對象文件(媒體文件和PDF文件等)。通常情況下,HTML不…
👁 497
常用正则表达式

常用正則表達式 踩坑總結

正則表達式網址(URL)[a-zA-z]+://[^\s]*IP地址(IP Address)((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)電子郵件(Email)\w+([-+.]\w+)*@\w+([-.]\w+)*…
👁 557

推薦閱讀

pbootcms配置留言发送到QQ邮箱教程

pbootcms配置留言發送到QQ郵箱教程 程序筆記 PbootCms

1、登陸QQ郵箱,找到設置》賬戶 &nbsp; 2、下拉找到SMTP服務設置,我們是發信,所以第一個和第二個都可以,兩個都帶有SMTP服務,我們選擇第一個點擊開啓 3、安全驗證,我們這裏選擇發送短信,根據頁面提示我們用手機發送短信,完成後點擊我已發送 &nbsp; 4、記住下面的授權碼,複製到剪切板…
👁 457
Warning: chmod(): Permission denied in

Warning: chmod(): Permission denied in 踩坑總結

這個警告通常是由於當前用戶沒有足夠的權限更改指定文件或目錄的權限所導致的。要解決這個問題,可以嘗試以下方法:檢查文件或目錄的所有權和權限是否正確。確保當前用戶具有更改權限的權限。如果您是在 Linux 系統上運行 PHP,則可以使用 chown 和 chmod 命令更改文件或目錄的所有權和權限。如果…
👁 406
(自适应手机版)响应式集团企业pbootcms网站模板 集团公司通用网站源码下载 0172

(自適應手機版)響應式集團企業pbootcms網站模板 集團公司通用網站源碼下載 0172 實用收藏 pbootcms模板

一款自適應手機版的響應式集團企業PbootCMS網站模板,適用於各類集團公司。設計風格高端大氣,功能模塊全面,能夠很好地展示集團架構、業務板塊與企業文化。是大型企業集團搭建品牌形象官網的通用選擇。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:admin 解壓密碼:www…
👁 288
(自适应手机版)响应式科技产品传感器类网站pbootcms模板 html5蓝色智能电子产品网站源码下载 0698

(自適應手機版)響應式科技產品傳感器類網站pbootcms模板 html5藍色智能電子產品網站源碼下載 0698 實用收藏 pbootcms模板

一款響應式科技產品與傳感器類PbootCMS網站模板,支持PC與WAP端。設計風格簡約科技,能夠展示傳感器、智能硬件等高科技產品。有助於科技研發企業在線上展示創新產品,吸引投資與合作伙伴。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:admin 解壓密碼:www.4s5…
👁 297
(自适应手机端)蓝色大气化工滤料石材厂家pbootcms模板 磨料生产网站源码下载 0754

(自適應手機端)藍色大氣化工濾料石材廠家pbootcms模板 磨料生產網站源碼下載 0754 實用收藏 pbootcms模板

一款藍色大氣化工濾料與磨料生產PbootCMS網站模板,支持PC與WAP端。設計風格專業穩重,適合展示化工濾料、磨料產品及工業應用。有助於化工材料企業在線上展示生產實力,吸引工業客戶。模板展示 安裝說明 網站後臺:/admin.php 賬號:admin 密碼:admin 解壓密碼:www.4s5.c…
👁 272