Hongmu Notes
Home Summary of pitfalls Customer service code on the side of the website Foldable ball customer service display
Summary of pitfalls

Customer service code on the side of the website Foldable ball customer service display

Customer service code on the side of the website Foldable ball customer service display

First is the html code:

<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>

Then the css code:

* {
    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;
}

Next is the js code:

$(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;
        }
    });
}); 

You need to introduce jQuery to take effect! At the same time, iconfont needs to introduce or find the corresponding icon yourself.

微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

Browser caching increases the speed of secondary visits to your website

Browser caching increases the speed of secondary visits to your website Summary of pitfalls

Use browser caching of official words: If users will visit your website multiple times, browser caching of static resources can save users time. Cache headers should be applied to all cacheable static resources, not just to a small subset of static resources (for example, images). Cacheable resources include JS and CSS files, image files, and other binary object files (media files, PDF files, etc.). Normally, HTML doesn’t…
👁 202

Recommended reading

Environmental Protection New Materials & New Energy Recycling Website Template – 0731

Environmental Protection New Materials & New Energy Recycling Website Template – 0731 Practical Collection Yiyou template

This EyouCMS template is ideal for enterprises specializing in eco-friendly new materials or new energy recycling. Its green technology design style is perfect for showcasing innovative environmental materials, energy recovery technologies, and related products. It helps environmental protection companies build a strong green brand image online and attract potential partners. Template Demo | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS...
👁 50
Responsive exhaust gas treatment environmental protection equipment website template – 0732

Responsive exhaust gas treatment environmental protection equipment website template – 0732 Practical Collection Yiyou template

An eyouCMS responsive website template designed for environmental protection equipment manufacturers specializing in exhaust gas treatment systems. Its modern, eco-friendly design is ideal for showcasing exhaust gas treatment equipment, technical solutions, and project cases. This template helps environmental engineering firms present their solutions online and attract both industrial and municipal clients. Template Overview | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Common Installation Questions for YououCMS...
👁 35
Environmental water governance website template 0733

Environmental water governance website template 0733 Practical Collection Yiyou template

This set of eyoucms templates is suitable for the environmental water treatment industry. The design style is professional and environmentally friendly, and can display water treatment projects, water treatment projects and technical solutions. It helps environmental water companies demonstrate their strength online and attract government and corporate customers. Template display Installation instructions Website backend: /login.php Account: admin Password: admin Related articles Summary of common problems in the installation of Yiyou CMS Yiyou CMS (Ey...
👁 49
Resource website typecho001 template

Resource website typecho001 template Program Notes Typecho

typecho001 template template please do not modify the folder name of this template. The folder name is: typecho001 1.4 Fix the js output problem on the article page 1.3 Fix the error prompt when the plug-in is not installed Optimize the list page code output 1.2 Fix the comment function and add a custom homepage title 1.1 Fix the comment reply asymmetry function Add a separate title setting function on the homepage Add the website favicon.ico icon Add one...
👁 198
Marketing-oriented plastic sheet purification and environmental protection equipment website template – 0734

Marketing-oriented plastic sheet purification and environmental protection equipment website template – 0734 Practical Collection Yiyou template

An EyouCMS website template designed for enterprises specializing in marketing-oriented plastic sheet products and environmental purification equipment. Its eco-friendly design is ideal for showcasing plastic sheet products, purification equipment, and technical solutions. This template helps environmental materials companies showcase their products online and attract industrial customers. Template Demo | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | Eyou...
👁 47
Modification of typecho paging style

Modification of typecho paging style Program Notes Typecho

Sir, times have changed! Typecho is currently the most perfect solution, because Baidu can only see the code of fixed thinking. The actual generated HTML code is breathtakingly clean and fully customized, including adding classes to the li element, adding classes to the a element, adding classes to the previous page and next page, and removing the li tags that come with typecho to express more. I can even add some text to the content inside...
👁 517