Hongmu Notes
Home Summary of pitfalls Back to top side button
Summary of pitfalls

Back to top side button

Back to top side button

1.html

 <dl class="toolbar">
        <dd class="qq"><a href="tencent://message/?uin=123456&Menu=yes"><i></i><span>在线客服</span></a></dd>
        <a href="tel:{pboot:companyphone}"><dd class="tel"><i></i><span>服务热线</span>
            <div class="box">
                <p>服务热线</p>
                <h3>{pboot:companyphone}</h3>
            </div>
        </dd>
        </a>
        <dd class="code d-none d-lg-block"><i></i><span>微信咨询</span>
            <div class="box"><img src="{pboot:companyweixin}" alt="{pboot:companyname}" />
            </div>
        </dd>
        <dd class="top" id="top"><i></i><span>返回顶部</span></dd>
    </dl>

2.css

.toolbar {
    position: fixed;
    top: 50%;
    right: 1%;
    margin-top: -163px;
    z-index: 100;
    width: 80px;
}

.toolbar dd {
    position: relative;
    float: left;
    width: 80px;
    height: 80px;
    background: #0c4197;
    margin-top: 2px;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    line-height: 21px;
    text-align: center;
    cursor: pointer;
    transition: all .5s;
}

.toolbar dd:first-child {
    margin-top: 0;
}

.toolbar dd i {
    width: 100%;
    height: 30px;
    display: block;
    margin-top: 13px;
    background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAB4CAYAAADlnULlAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyFpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDE0IDc5LjE1MTQ4MSwgMjAxMy8wMy8xMy0xMjowOToxNSAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50Y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gTnnijvmGZlNHDTRo8jQE5LP+fhxTxCUsKmOVL2ifq1XKbCMcl8Rrcq+TTVMnPMtNhBFOeArXhKlx3LOm8bBN3eAh2hCmjxs8a+qcb9A8ELnGizz2NOV+bZMGpXy/UeXeuoRFlCcuxcc0H7/+sT5WDa4eqokprMyUAVllyDM305YrpugflXFok+KfAQeoLxN0bHQ1mTELMyjHH6B8jaZ8eVl4c1pVrZaXpdc25lpjG4MvT/zrVH3qOjv51KgxzLS4N019G3MRLspGp+eWqTnhrLq37ZHjv0YeS7OO+FV2omlUi/m4MAOV/B0UBL1OxXwtqwn8b6dC1YpQWn2KWavv75W4/97W6fQJoDJT+9UqzgO/Mj+qJhvC57C/j01OXlqFz2bfllP/1vI/EqdkQvhccJAEbgKT6fxa+iTg1Oy2ouWsT5sprpau76fredLvr6GFS9i28BLFd4pHWdx8Jl4VRriU1XSJdG+u/IVUIV7tIzye/hIW4XHFfZ2w4C4mfrmr8BFNTW2EBXcy8XyX36rEmncEeMjTNj8L8sGYyPFfZq29zCfTMDE05xyBnHBOeEgLp37PGJVt4S5yWTtzi7YhLfyXAAMAHtAGN6ll70QAAAAASUVORK5CYII=) no-repeat center 0;
}

.toolbar dd.qq i {
    background-position-y: 0;
}

.toolbar dd.tel i {
    background-position-y: -30px;
}

.toolbar dd.code i {
    background-position-y: -60px;
}

.toolbar dd.top i {
    background-position-y: -90px;
}

.toolbar dd span {
    display: block;
    color: #fff;
}

.toolbar dd.tel .box {
    position: absolute;
    top: 0;
    width: 190px;
    right: -200px;
    height: 100%;
    margin-right: 10px;
    border-radius: 5px;
    background: #0c4197;
    opacity: 0;
    transition: all .5s;
}

.toolbar dd.tel .box p {
    font-size: 14px;
    margin: 15px auto 7px;
    color: #fff;
}

.toolbar dd.tel .box h3 {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.toolbar dd.tel .box:after {
    display: block;
    content: " ";
    border-style: solid dashed dashed dashed;
    border-color: transparent transparent transparent #0c4197;
    border-width: 9px;
    width: 0;
    height: 0;
    position: absolute;
    top: 50%;
    margin-top: -9px;
    right: -18px;
    margin-left: -12px;
}

.toolbar dd.code .box {
    position: absolute;
    top: 0;
    width: 162px;
    right: -172px;
    height: 162px;
    margin-right: 10px;
    border-radius: 5px;
    background: #0c4197;
    opacity: 0;
    transition: all .5s;
}

.toolbar dd.code .box img {
    width: 140px;
    height: 140px;
    padding: 11px;
}

.toolbar dd.code .box:after {
    display: block;
    content: " ";
    border-style: solid dashed dashed dashed;
    border-color: transparent transparent transparent #0c4197;
    border-width: 9px;
    width: 0;
    height: 0;
    position: absolute;
    top: 30px;
    right: -18px;
    margin-left: -12px;
}

.toolbar dd:hover {
    background: #333;
}

.toolbar dd.tel:hover .box {
    opacity: 1;
    right: 80px;
}

.toolbar dd.code:hover .box {
    opacity: 1;
    right: 80px;
}

3.js

 <script>
 $(document).ready(function(){
    $("#top").click(function(){
      $("body, html").stop().animate({
         "scrollTop": 0
       });
    });
});
       
</script
微信赞赏

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

Heavy Industry Machinery – Excavator Website Template 0663

Heavy Industry Machinery – Excavator Website Template 0663 Practical Collection Yiyou template

This EyouCMS template is designed for the heavy machinery and excavator industry, featuring a bold yellow design style ideal for showcasing excavator products, heavy-duty machinery equipment, technical specifications, and construction case studies. It enables heavy machinery enterprises to showcase their products online and attract mining and infrastructure clients. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS...
👁 49
Responsive Logistics System Equipment Website Template 0664

Responsive Logistics System Equipment Website Template 0664 Practical Collection Yiyou template

An eyouCMS responsive website template designed for the logistics system and equipment industry. Its professional, tech-oriented design is ideal for showcasing logistics systems, warehousing equipment, solutions, and project cases. This template helps logistics equipment companies present their products online and attract both e-commerce and logistics clients. Template Overview | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for YououCMS...
👁 38
Sculpture Machine & Equipment Website Template 0665

Sculpture Machine & Equipment Website Template 0665 Practical Collection Yiyou template

This EyouCMS template is designed for the sculpture machine and mechanical equipment industry, featuring a professional industrial design style that effectively showcases sculpture machine products, mechanical equipment, technical specifications, and industrial applications. It enables machinery manufacturing enterprises to present their products online and attract industrial customers. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS (...
👁 53
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...
👁 199
Responsive office supplies service company website template 0666

Responsive office supplies service company website template 0666 Practical Collection Yiyou template

An eyouCMS responsive website template designed for office supplies and service companies. Its professional and practical design effectively showcases office supply products, corporate services, solutions, and brand identity. This template helps office supply businesses showcase their products online and attract corporate clients. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for YouyouCMS...
👁 34
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