• JS原生-弹框+阿里巴巴矢量图


    效果:

     代码:

    1. html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
    6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    7. <title>弹出框title>
    8. <style>
    9. .icon {
    10. width: 1em;
    11. height: 1em;
    12. vertical-align: -1.17em;
    13. margin-left: 165px;
    14. fill: currentColor;
    15. overflow: hidden;
    16. }
    17. #main {
    18. width: 100%;
    19. height: 100%;
    20. background-color: rgba(82, 82, 87, 0.5);
    21. display: flex;
    22. justify-content: center;
    23. align-items: center;
    24. position: absolute;
    25. left: 0;
    26. top: 0;
    27. display: none;
    28. }
    29. #box {
    30. width: 474px;
    31. height: 57px;
    32. background: #F0F9EB;
    33. border-radius: 6px;
    34. position: absolute;
    35. /* z-index: 999; */
    36. }
    37. #stopIt {
    38. text-decoration: none;
    39. color: #17BE59;
    40. float: right;
    41. padding-top: 5px;
    42. margin-right: 10px;
    43. }
    44. p {
    45. font-size: 22px;
    46. font-family: Source Han Sans CN;
    47. font-weight: 400;
    48. color: #17BE59;
    49. margin: -21px 190px;
    50. }
    51. #box1 {
    52. width: 496px;
    53. height: 50px;
    54. border: 2px solid black;
    55. }
    56. #box2 {
    57. width: 0px;
    58. height: 50px;
    59. background-color: pink;
    60. }
    61. style>
    62. head>
    63. <body>
    64. <script src="../概述/script/iconfont.js">script>
    65. <input type="button" value="弹框" id="eject">
    66. <div id="main">
    67. <div id="box">
    68. //对号
    69. <svg class="icon" aria-hidden="true">
    70. <use xlink:href="#icon-tijiaochenggong">use>
    71. svg>
    72. //差号
    73. <svg class="icon" id="stopIt" aria-hidden="true">
    74. <use xlink:href="#icon-guanbi">use>
    75. svg>
    76. <p>提交成功p>
    77. div>
    78. div>
    79. <script>
    80. let eject = document.getElementById("eject");
    81. let main = document.getElementById("main");
    82. let stopIt = document.getElementById("stopIt");
    83. //点击出现弹框
    84. eject.onclick = function () {
    85. main.style.display = "flex";
    86. }
    87. //点击×弹框消失
    88. stopIt.onclick = function () {
    89. main.style.display = "none";
    90. }
    91. script>
    92. body>
    93. html>

    字体JS文件:cankao

    window._iconfont_svg_string_='',function(n){var t=(t=document.getElementsByTagName("script"))[t.length-1],e=t.getAttribute("data-injectcss"),t=t.getAttribute("data-disable-injectsvg");if(!t){var i,o,c,d,s,a=function(t,e){e.parentNode.insertBefore(t,e)};if(e&&!n.__iconfont__svg__cssinject__){n.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(t){console&&console.log(t)}}i=function(){var t,e=document.createElement("div");e.innerHTML=n._iconfont_svg_string_,(e=e.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",e=e,(t=document.body).firstChild?a(e,t.firstChild):t.appendChild(e))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(i,0):(o=function(){document.removeEventListener("DOMContentLoaded",o,!1),i()},document.addEventListener("DOMContentLoaded",o,!1)):document.attachEvent&&(c=i,d=n.document,s=!1,r(),d.onreadystatechange=function(){"complete"==d.readyState&&(d.onreadystatechange=null,l())})}function l(){s||(s=!0,c())}function r(){try{d.documentElement.doScroll("left")}catch(t){return void setTimeout(r,50)}l()}}(window);

     参考文档:Js简朴原生实现弹框_原生js弹框_想被带飞的鱼的博客-CSDN博客

  • 相关阅读:
    外贸案例分享:看销冠给客户打电话!
    【Transformers】第 3 章:自动编码语言模型
    代码随想录算法训练营Day36 || leetCode 435. 无重叠区间 || 763.划分字母区间 || 56. 合并区间
    如何通过实际操作来加深对Linux命令和概念的理解?
    [附源码]SSM计算机毕业设计政府项目管理平台JAVA
    LQ0041 特别数的和【进制】
    9月有哪些程序员新书与您相约?
    前端开发工具vscode
    自动化测试测试框架封装改造
    大势所趋!低代码带来开发行业新一轮春风
  • 原文地址:https://blog.csdn.net/qq_45915072/article/details/134440978