1. <abbr id="pmhhd"><strike id="pmhhd"></strike></abbr>
    2. \r\n\r\n 3秒后會(huì)在右下角自動(dòng)彈出窗口,如果沒(méi)有彈出請(qǐng)點(diǎn)擊這個(gè)按鈕<\/button>\r\n<\/p>\r\n\r\n 您有新的短消息!X<\/span><\/p>\r\n 1條未讀信息(<\/p>\r\n<\/p>\r\n<\/body>\r\n<\/html><\/pre>

      The above code implements the functions we need. Here is a brief introduction to the implementation process. Implementation principle:<\/strong>The principle is very simple. Here is a brief introduction step by step:1. Let the window be located in the lower right corner of the web page:<\/strong><\/span>The implementation code is as follows:<\/p>

      #winpop {\r\n width:200px;\r\n height:0px;\r\n position:absolute;\r\n right:0;\r\n bottom:0;\r\n border:1px solid #666;\r\n margin:0;\r\n padding:1px;\r\n overflow:hidden;\r\n display:none;\r\n}<\/pre>

      The above code sets the windpop element to absolute positioning<\/a>, especially its right and bottom attribute values ????are set to 0, so that Ensure that it is located in the lower right corner of the web page, and also set its height to 0px, which means it is hidden by default.
      2. How to show and hide:
      <\/strong><\/span>The changeH() function is called every specified time through the timer function setInterval(). This function can be based on the passed value. Constantly set the height of windpop, so as to achieve the effect of this window appearing and disappearing smoothly. The principle is roughly the same as above, so I won’t introduce it much here. <\/p>\n

      Summary: <\/strong><\/span>
      <\/p>\n

      #This article provides a better explanation to friends through examples and an introduction to the implementation process and principles. I have used JavaScript to realize the method of popping up the prompt box in the lower right corner. I believe everyone has a better understanding of this! Hope it helps with your work! <\/p>\n

      Related recommendations: <\/strong><\/span><\/p>\n

      Pure js pop-up window example code in the lower right corner<\/a><\/span><\/p>\n

      js Pop-up window effect code in the lower right corner (IE only)<\/a><\/span><\/p>\n

      js realizes the pop-up window in the lower right corner imitating MSN with closing function Window code<\/span><\/a><\/p>"}

      国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

      Home Web Front-end JS Tutorial JavaScript method to implement pop-up prompt box in the lower right corner

      JavaScript method to implement pop-up prompt box in the lower right corner

      Dec 05, 2017 pm 02:26 PM
      javascript js lower right corner

      In our daily development work, we often encounter small functions that require pop-up prompt boxes or advertisements in the lower right corner of the page. This is to provide a better user experience. So how to implement a pop-up prompt box in the lower right corner of the web page? ? Today we will introduce to you how to use JavaScript to realize the pop-up prompt box in the lower right corner!

      This articleexplains with examplesThe example code of the pop-up advertising information box in the lower right corner of the web page is shared with everyone for your reference. The specific content is as follows

      Rendering:

      Specific code:

      <!DOCTYPE html>
      <html>
      <head>
      <meta charset="gb2312">
      <title>網(wǎng)頁(yè)右下角的信息框</title>
      </head>
      <style type="text/css">
      #winpop {
       width:200px;
       height:0px;
       position:absolute;
       right:0;
       bottom:0;
       border:1px solid #666;
       margin:0;
       padding:1px;
       overflow:hidden;
       display:none;
      }
      #winpop .title{
       width:100%;
       height:22px;
       line-height:20px;
       background:#FFCC00;
       font-weight:bold;
       text-align:center;
       font-size:12px;
      }
      #winpop .con{
       width:100%;
       height:90px;
       line-height:80px;
       font-weight:bold;
       font-size:12px;
       color:#FF0000;
       text-decoration:underline;
       text-align:center
      }
      #silu{
       font-size:12px;
       color:#666;
       position:absolute;
       right:0;
       text-decoration:underline;
       line-height:22px;
      }
      .close{
       position:absolute;
       right:4px;
       top:-1px;
       color:#FFF;
       cursor:pointer
      }
      </style>
      <script type="text/javascript">
      function tips_pop(){
       var MsgPop=document.getElementById("winpop");
       var popH=parseInt(MsgPop.style.height);//將對(duì)象的高度轉(zhuǎn)化為數(shù)字
       if(popH==0){
       MsgPop.style.display="block";//顯示隱藏的窗口
       show=setInterval("changeH(&#39;up&#39;)",2);
       }
       else{ 
       hide=setInterval("changeH(&#39;down&#39;)",2);
       }
      }
      function changeH(str){
       var MsgPop=document.getElementById("winpop");
       var popH=parseInt(MsgPop.style.height);
       if(str=="up"){
       if(popH<=100){
       MsgPop.style.height=(popH+4).toString()+"px";
       }
       else{ 
       clearInterval(show);
       }
       }
       if(str=="down"){ 
       if(popH>=4){ 
       MsgPop.style.height=(popH-4).toString()+"px";
       }
       else{ 
       clearInterval(hide); 
       MsgPop.style.display="none"; //隱藏p
       }
       }
      }
      window.onload=function(){
       var oclose=document.getElementById("close");
       var bt=document.getElementById("bt");
       document.getElementById(&#39;winpop&#39;).style.height=&#39;0px&#39;;
       setTimeout("tips_pop()",3000);
       oclose.onclick=function(){tips_pop()}
       bt.onclick=function(){tips_pop()}
      }
      </script>
      <body>
      <p id="silu">
       <button id="bt">3秒后會(huì)在右下角自動(dòng)彈出窗口,如果沒(méi)有彈出請(qǐng)點(diǎn)擊這個(gè)按鈕</button>
      </p>
      <p id="winpop">
       <p class="title">您有新的短消息!<span class="close" id="close">X</span></p>
       <p class="con">1條未讀信息(</p>
      </p>
      </body>
      </html>

      The above code implements the functions we need. Here is a brief introduction to the implementation process.
      Implementation principle:
      The principle is very simple. Here is a brief introduction step by step:
      1. Let the window be located in the lower right corner of the web page:
      The implementation code is as follows:

      #winpop {
       width:200px;
       height:0px;
       position:absolute;
       right:0;
       bottom:0;
       border:1px solid #666;
       margin:0;
       padding:1px;
       overflow:hidden;
       display:none;
      }

      The above code sets the windpop element to absolute positioning, especially its right and bottom attribute values ????are set to 0, so that Ensure that it is located in the lower right corner of the web page, and also set its height to 0px, which means it is hidden by default.
      2. How to show and hide:
      The changeH() function is called every specified time through the timer function setInterval(). This function can be based on the passed value. Constantly set the height of windpop, so as to achieve the effect of this window appearing and disappearing smoothly. The principle is roughly the same as above, so I won’t introduce it much here.

      Summary:

      #This article provides a better explanation to friends through examples and an introduction to the implementation process and principles. I have used JavaScript to realize the method of popping up the prompt box in the lower right corner. I believe everyone has a better understanding of this! Hope it helps with your work!

      Related recommendations:

      Pure js pop-up window example code in the lower right corner

      js Pop-up window effect code in the lower right corner (IE only)

      js realizes the pop-up window in the lower right corner imitating MSN with closing function Window code

      The above is the detailed content of JavaScript method to implement pop-up prompt box in the lower right corner. For more information, please follow other related articles on the PHP Chinese website!

      Statement of this Website
      The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

      Hot AI Tools

      Undress AI Tool

      Undress AI Tool

      Undress images for free

      Undresser.AI Undress

      Undresser.AI Undress

      AI-powered app for creating realistic nude photos

      AI Clothes Remover

      AI Clothes Remover

      Online AI tool for removing clothes from photos.

      Clothoff.io

      Clothoff.io

      AI clothes remover

      Video Face Swap

      Video Face Swap

      Swap faces in any video effortlessly with our completely free AI face swap tool!

      Hot Tools

      Notepad++7.3.1

      Notepad++7.3.1

      Easy-to-use and free code editor

      SublimeText3 Chinese version

      SublimeText3 Chinese version

      Chinese version, very easy to use

      Zend Studio 13.0.1

      Zend Studio 13.0.1

      Powerful PHP integrated development environment

      Dreamweaver CS6

      Dreamweaver CS6

      Visual web development tools

      SublimeText3 Mac version

      SublimeText3 Mac version

      God-level code editing software (SublimeText3)

      How to remove the evaluation copy watermark in the lower right corner of win11 24H2? Tips for removing the evaluation copy in the lower right corner of win11 How to remove the evaluation copy watermark in the lower right corner of win11 24H2? Tips for removing the evaluation copy in the lower right corner of win11 Jun 01, 2024 pm 09:52 PM

      How to remove the evaluation copy text in the lower right corner of win1124H2? When we use the system, sometimes the desktop will display a transparent watermark on the lower right corner of the screen. So how do we remove this transparent watermark? Users can directly use third-party software to operate. Let this site carefully introduce to users how to remove the watermark on the win1124H2 evaluation copy. To remove the watermark on the win1124H2 evaluation copy, download the UniversalWatermarkDisabler tool. After running it, the current system version and watermark status will be displayed. If "Ready for installation" is displayed in "Status", it can be removed.

      WebSocket and JavaScript: key technologies for implementing real-time monitoring systems WebSocket and JavaScript: key technologies for implementing real-time monitoring systems Dec 17, 2023 pm 05:30 PM

      WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

      Recommended: Excellent JS open source face detection and recognition project Recommended: Excellent JS open source face detection and recognition project Apr 03, 2024 am 11:55 AM

      Face detection and recognition technology is already a relatively mature and widely used technology. Currently, the most widely used Internet application language is JS. Implementing face detection and recognition on the Web front-end has advantages and disadvantages compared to back-end face recognition. Advantages include reducing network interaction and real-time recognition, which greatly shortens user waiting time and improves user experience; disadvantages include: being limited by model size, the accuracy is also limited. How to use js to implement face detection on the web? In order to implement face recognition on the Web, you need to be familiar with related programming languages ??and technologies, such as JavaScript, HTML, CSS, WebRTC, etc. At the same time, you also need to master relevant computer vision and artificial intelligence technologies. It is worth noting that due to the design of the Web side

      How to implement an online speech recognition system using WebSocket and JavaScript How to implement an online speech recognition system using WebSocket and JavaScript Dec 17, 2023 pm 02:54 PM

      How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

      Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS Essential tools for stock analysis: Learn the steps to draw candle charts with PHP and JS Dec 17, 2023 pm 06:55 PM

      Essential tools for stock analysis: Learn the steps to draw candle charts in PHP and JS. Specific code examples are required. With the rapid development of the Internet and technology, stock trading has become one of the important ways for many investors. Stock analysis is an important part of investor decision-making, and candle charts are widely used in technical analysis. Learning how to draw candle charts using PHP and JS will provide investors with more intuitive information to help them make better decisions. A candlestick chart is a technical chart that displays stock prices in the form of candlesticks. It shows the stock price

      JavaScript and WebSocket: Building an efficient real-time weather forecasting system JavaScript and WebSocket: Building an efficient real-time weather forecasting system Dec 17, 2023 pm 05:13 PM

      JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

      Simple JavaScript Tutorial: How to Get HTTP Status Code Simple JavaScript Tutorial: How to Get HTTP Status Code Jan 05, 2024 pm 06:08 PM

      JavaScript tutorial: How to get HTTP status code, specific code examples are required. Preface: In web development, data interaction with the server is often involved. When communicating with the server, we often need to obtain the returned HTTP status code to determine whether the operation is successful, and perform corresponding processing based on different status codes. This article will teach you how to use JavaScript to obtain HTTP status codes and provide some practical code examples. Using XMLHttpRequest

      PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts PHP and JS Development Tips: Master the Method of Drawing Stock Candle Charts Dec 18, 2023 pm 03:39 PM

      With the rapid development of Internet finance, stock investment has become the choice of more and more people. In stock trading, candle charts are a commonly used technical analysis method. It can show the changing trend of stock prices and help investors make more accurate decisions. This article will introduce the development skills of PHP and JS, lead readers to understand how to draw stock candle charts, and provide specific code examples. 1. Understanding Stock Candle Charts Before introducing how to draw stock candle charts, we first need to understand what a candle chart is. Candlestick charts were developed by the Japanese

      See all articles