码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • vue手搓悬浮在线客服按钮


    1. <template>
    2. <div id="app">
    3. <Header>Header>
    4. <div class="floating-module">
    5. <button class="floating-button" id="online-service" @click="kefu()">
    6. <img src="@/assets/icon/客服.png" alt="在线客服">
    7. button>
    8. <button class="floating-button" id="phone-service" @click="dianhua()">
    9. <img src="@/assets/icon/电话.png" alt="电话咨询">
    10. button>
    11. div>
    12. <router-view>router-view>
    13. <Footer>Footer>
    14. div>
    15. template>
    16. <script>
    17. import Header from '@/components/Header/Header'
    18. import Footer from '@/components/Footer/Footer'
    19. export default {
    20. name: 'App',
    21. components: {
    22. Header,
    23. Footer
    24. },
    25. methods:{
    26. kefu(){
    27. alert('客服')
    28. },
    29. dianhua(){
    30. alert('电话')
    31. }
    32. }
    33. }
    34. script>
    35. <style>
    36. #app {
    37. font-family: Avenir, Helvetica, Arial, sans-serif;
    38. -webkit-font-smoothing: antialiased;
    39. -moz-osx-font-smoothing: grayscale;
    40. /* text-align: center; */
    41. /* color: #2c3e50; */
    42. /* margin-top: 60px; */
    43. /* padding-top:100px; */
    44. }
    45. a{
    46. text-decoration: none;
    47. color: #000000;
    48. }
    49. li{
    50. list-style: none;
    51. }
    52. *{
    53. margin: 0;
    54. padding: 0;
    55. }
    56. @media screen and (max-width:768px) {
    57. /* #app {
    58. padding-top:200px;
    59. } */
    60. }
    61. .floating-module {
    62. position: fixed;
    63. right: 10px;
    64. top: 50%;
    65. transform: translateY(-50%);
    66. display: flex;
    67. flex-direction: column;
    68. align-items: center;
    69. z-index: 999;
    70. }
    71. .floating-button {
    72. width: 50px;
    73. height: 50px;
    74. background-color: #ffffff;
    75. color: white;
    76. border: none;
    77. border-radius: 50%;
    78. margin: 5px 0;
    79. display: flex;
    80. align-items: center;
    81. justify-content: center;
    82. cursor: pointer;
    83. box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
    84. transition: background-color 0.3s, transform 0.3s;
    85. }
    86. .floating-button:hover {
    87. background-color: #4095e5;
    88. transform: scale(1.1);
    89. }
    90. .floating-button img {
    91. width: 50%;
    92. height: 50%;
    93. }
    94. style>

  • 相关阅读:
    React的基础用法-创建组件、渲染组件、处理状态和事件
    【无标题】
    [Acwing | 周赛] 第70场周赛
    超视频时代,什么样的技术会成为底座?
    InfiniTAM v3中localVBA的使用原理
    STM8的C语言编程(10)--+修改CPU的时钟
    软件测试面试简历,三年测试项目经验怎么写?
    java构建树
    SpringBoot SpringBoot 基础篇 1 快速上手SpringBoot 1.6 入门案例解析【parent】
    list的简单模拟实现
  • 原文地址:https://blog.csdn.net/p_s_p/article/details/140986881
  • 最新文章
  • 你的Agent API还在裸奔?从认证到沙箱,我用FastAPI搭了几道防线
    13、PushbackInputStream和StreamTokenizer的源码分析和使用方法详细分析
    上周热点回顾(5.11-5.17)
    .NET 8 Web开发入门(五):构建盾牌——数据验证与全局异常处理
    [深度学习] 大模型学习8上-推理部署框架llama.cpp与Ollama使用指北
    架构融合:Activity Host 作为确定性编排与认知智能代理的桥梁
    图生视频模型训练数据集
    为什么 AI 助理总不好用?因为它不知道你发生了什么!
    ERC-7730:解析签名意图,消除盲签风险
    RAG学习笔记(2):关于rag和模型微调,同一个问题它们分别怎么处理
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号