Home > Web Front-end > JS Tutorial > body text

The use of js timer (explanation with examples)_javascript skills

WBOY
Release: 2016-05-16 17:05:16
Original
944 people have browsed it

In javascript, there are two dedicated functions for timers, namely:

1. Countdown timer: timename=setTimeout("function();",delaytime);
2. Loop timer: timename=setInterval("function();",delaytime);

The first parameter "function()" is the action to be executed when the timer is triggered. It can be one function or several functions. The functions can be separated by ";". For example, if you want to pop up two warning windows, you can replace "function();" with
"alert('First warning window!'); alert('Second warning window!');"; and The second parameter "delaytime" is the interval time in milliseconds, that is, filling in "5000" means 5 seconds.
The countdown timer triggers an event after the specified time arrives, while the loop timer triggers the event repeatedly when the interval arrives. The difference between the two is that the former only works once, while the latter works continuously.
For example, after you open a page and want to automatically jump to another page every few seconds, you need to use the countdown timer "setTimeout("function();",delaytime)", and if you want to To set a sentence to appear one word at a time,
requires the use of the loop timer "setInterval("function();",delaytime)".

To obtain the focus of the form, document.activeElement.id is used. Use if to determine whether document.activeElement.id and the form's ID are the same.
For example: if ("mid" == document.activeElement.id) {alert();}, "mid" is the ID corresponding to the form.

Timer:
is used to specify a program to be executed after a specific period of time.

Timing execution in JS, the difference between setTimeout and setInterval, and the cancellation method

setTimeout(Expression,DelayTime), after DelayTime, an Expression will be executed. setTimeout is used to delay for a period of time before performing an operation.
setTimeout("function",time) sets a timeout object

setInterval(expression, delayTime), Expression will be executed for each DelayTime. It can often be used to refresh expressions.
setInterval("function", time) sets a timeout object

SetInterval is automatically repeated, and setTimeout will not be repeated.

clearTimeout(object) clears the setTimeout object
clearInterval(object) clears the setInterval object

Just give two examples.
Example 1. When the form is triggered or loaded, output the string verbatim

Copy code The code is as follows:




Untitled Document








Example 2. When the focus is on the input box, check the input box information regularly, and do not perform the checking action when the focus is not on.

Copy code The code is as follows:




< title>Untitled document












Example 3. The following is the simplest example. A warning window pops up after the timer expires.

Copy code The code is as follows:




< ;script language="javascript">
function count() {
document.getElementByIdx_x_x('m').innerHTML="Timer has started!";
setTimeout("alert('Ten seconds to! ')",10000)
}



< input TYPE="button" value=" Timing starts" onclick="count()">


Example 4: Countdown time jump

Copy code The code is as follows:




My JSP 'ds04.jsp' starting page</ title><br> <span id="tiao">3</span><br> <a href="javascript:countDown"> </a>Automatically jump after seconds...<br> <meta http-equiv=refresh content=3;url= '/ds02.jsp'/><br> <!--Start script--><br> <script language="javascript" type= ""><br>function countDown(secs){<br> tiao.innerText=secs;<br> if(--secs>0)<br> setTimeout("countDown(" secs ")",1000); <br> }<br> countDown(3);<br> </script><br> <!--End of script--><br> </head><br> </div> <br><br>Example 6: <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="44219" class="copybut" id="copybut44219" onclick="doCopy('code44219')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code44219"> <br><head> <br> <meta http- equiv="refresh" content="2;url='b.html'"> <br></head> <br> </div> <p>Example 7:</p> <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="26465" class="copybut" id="copybut26465" onclick="doCopy('code26465')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code26465"> <br><script language="javascript" type="text /javascript"><br> setTimeout("window.location.href='b.html'", 2000);<br> //Both of the following two can be used<br> //setTimeout("javascript:location. href='b.html'", 2000);<br> //setTimeout("window.location='b.html'", 2000);<br></script><br> </div> <p>Example 8:</p> <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="53168" class="copybut" id="copybut53168" onclick="doCopy('code53168')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code53168"> <br><span id="totalSecond">2< /span><br><script language="javascript" type="text/javascript"><br> var second = document.getElementByIdx_x('totalSecond').innerHTML;<br> if(isNaN(second)) {<br> //...not a number processing method<br> }else{<br> setInterval(function(){<br> document.getElementByIdx_x('totalSecond').innerHTML = --second;<br> if (second <= 0) {<br> window.location = 'b.html';<br> }<br> }, 1000);<br> } <br></script><br> </div> <p>js timer (execute once, repeat)</p> <p>Share a piece of js code, a small example of js timer, which is divided into a timer that is executed once and a timer that is executed repeatedly. For reference for beginners. </p> <p>1, a timer that only executes once </p> <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="73058" class="copybut" id="copybut73058" onclick="doCopy('code73058')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code73058"> <br><script> <br>//Timer asynchronous Run <br>function hello(){ <br> alert("hello"); <br>} <br>//Use the method name to execute the method <br>var t1 = window.setTimeout(hello,1000); <br>var t2 = window.setTimeout("hello()",3000);//Use string execution method <br>window.clearTimeout(t1);//Remove the timer <br></script><br> </div> <p>2, timer for repeated execution</p> <p></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="39946" class="copybut" id="copybut39946" onclick="doCopy('code39946')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code39946"> <br><script> <br>function hello(){ <br> alert("hello"); <br>} <br>//Repeatedly execute a method <br>var t1 = window. setInterval(hello,1000); <br>var t2 = window.setInterval("hello()",3000); <br>//How to remove the timer <br>window.clearInterval(t1); <br>&lt ;/script><br> </div> <p>Remarks: </p> <p>If there are two methods in a page, both of which are executed after the page is loaded, but actually cannot be executed in order, you can refer to the following method to solve the problem: <br>You can add a timer in the onload method , set a timer, "delay" for a period of time before running, which can be considered to distinguish the order of page loading and running methods. </p> <p><br><br></p> <div class="codetitle"> <span><a style="CURSOR: pointer" data="39283" class="copybut" id="copybut39283" onclick="doCopy('code39283')"><u>Copy code</u></a></span> The code is as follows:</div> <div class="codebody" id="code39283"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br><html xmlns="http://www.w3.org/1999/xhtml"><br><head runat="server"><br>    <title>Untitled Page</title> <p>    <script language="javascript" type="text/javascript"><br>    var YC = new Object();<br>    function beginYC()<br>    {<br>        var secondsYC = document.getElementById("txtYCSeconds").value;<br>        try<br>        { <br>            YC = setTimeout("alert('延迟"+secondsYC+"秒成功')",secondsYC*1000);<br>        }<br>        catch(e)<br>        {<br>            alert("请输入正确的秒数。");<br>        }<br>    }<br>    function overYC()<br>    {<br>        clearTimeout(YC);<br>        YC=null;<br>        alert("终止延迟成功。");<br>    }<br><br>/**************************↓↓↓↓定时器的使用↓↓↓↓********************************/<br><br>    var timerDS = new Object();<br>    var timerDDS = new Object();<br>    function beginDS()<br>    {<br>        sn.innerHTML = "0";<br>        timerDS = setInterval("addOne()",parseInt(document.getElementById("txtIntervalSeconds").value,10)*1000);<br>    }<br>    function goonDS()<br>    {<br>        timerDS = setInterval("addOne()",parseInt(document.getElementById("txtIntervalSeconds").value,10)*1000);<br>    }<br>    function overDS()<br>    {<br>        clearInterval(timerDS);<br>        timerDS=null;<br>    }<br>    function delayDS()<br>    {<br>        overDS();<br>        timerDDS = setTimeout("goonDS()",document.getElementById("txtDDSSeconds").value*1000);<br>    }<br>    function addOne()<br>    {<br>        if(sn.innerHTML=="10")<br>        {<br>            overDS();<br>            alert("恭喜你,已成功达到10秒");<br>            return;<br>        }<br>        sn.innerHTML=parseInt(sn.innerHTML,10)+1;<br>    }<br><br>    </script></p> <p></head><br><body><br>    <form id="form1" runat="server"><br>    <div><br>        延迟器的使用:</div><br>    <div><br>     <label id="Label2" title="延迟秒数:"></label><br>        <input type="text" id="txtYCSeconds" value="3" /><br>        <input type="button" id="btnBYC" onclick="javascript:beginYC()" value="开始延迟" /><br>        <input type="button" id="btnOYC" onclick="javascript:overYC()" value="终止延迟" /><br>        <input type="button" id="Button1" onclick="javascript:alert('good monrning');" value="普通弹窗" /><br>    </div><br>    <br /><br>    <div><br>        定时器的使用:</div><br>    <div><br>    <div id="sn">0</div><br>  <label id="Label1" title="Timer interval seconds:"></label><br> > btnODS" onclick="javascript:overDS()" value="Terminate timing" /><br>   <input type="button" id="btnGDS" onclick="javascript:goonDS()" value="Continue timing " /><br><br>  <label id="ds" title="Delay seconds:"></label><br> ="5" /><br>                                                                                                                                                        div><br> </form><br></body><br></html><br><br><br></p> </div> </div> </div> </div> <div style="height: 25px;"> <div class="wzconBq" style="display: inline-flex;"> <span>Related labels:</span> <div class="wzcbqd"> <a onclick="hits_log(2,'www',this);" href-data="http://www.php.cn/search?word=js" target="_blank">js</a> <a onclick="hits_log(2,'www',this);" href-data="http://www.php.cn/search?word=timer" target="_blank">timer</a> </div> </div> <div style="display: inline-flex;float: right; color:#333333;">source:php.cn</div> </div> <div class="wzconOtherwz"> <a href="http://www.php.cn/faq/14539.html" title="DataGrid result set clearing method in EasyUI component under Jquery_jquery"> <span>Previous article:DataGrid result set clearing method in EasyUI component under Jquery_jquery</span> </a> <a href="http://www.php.cn/faq/14541.html" title="Method to pass Array object array in JS to the background in JSON format_javascript skills"> <span>Next article:Method to pass Array object array in JS to the background in JSON format_javascript skills</span> </a> </div> <div class="wzconShengming"> <div class="bzsmdiv">Statement of this Website</div> <div>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</div> </div> <div class="wwads-cn wwads-horizontal" data-id="156" style="max-width:955px"></div> <div class="wzconZzwz"> <div class="wzconZzwztitle">Latest Articles by Author</div> <ul> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796639331.html">What is a NullPointerException, and how do I fix it?</a> </div> <div>2024-10-22 09:46:29</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796629482.html">From Novice to Coder: Your Journey Begins with C Fundamentals</a> </div> <div>2024-10-13 13:53:41</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796628545.html">Unlocking Web Development with PHP: A Beginner's Guide</a> </div> <div>2024-10-12 12:15:51</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796627928.html">Demystifying C: A Clear and Simple Path for New Programmers</a> </div> <div>2024-10-11 22:47:31</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796627806.html">Unlock Your Coding Potential: C Programming for Absolute Beginners</a> </div> <div>2024-10-11 19:36:51</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796627670.html">Unleash Your Inner Programmer: C for Absolute Beginners</a> </div> <div>2024-10-11 15:50:41</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796627643.html">Automate Your Life with C: Scripts and Tools for Beginners</a> </div> <div>2024-10-11 15:07:41</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796627620.html">PHP Made Easy: Your First Steps in Web Development</a> </div> <div>2024-10-11 14:21:21</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796627574.html">Build Anything with Python: A Beginner's Guide to Unleashing Your Creativity</a> </div> <div>2024-10-11 12:59:11</div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots"></span> <a target="_blank" href="http://www.php.cn/faq/1796627539.html">The Key to Coding: Unlocking the Power of Python for Beginners</a> </div> <div>2024-10-11 12:17:31</div> </li> </ul> </div> <div class="wzconZzwz"> <div class="wzconZzwztitle">Latest Issues</div> <div class="wdsyContent"> <div class="wdsyConDiv flexRow wdsyConDiv1"> <div class="wdcdContent flexColumn"> <a href="http://www.php.cn/wenda/176381.html" target="_blank" title="Can a workerpool declared in multiple routes still maintain its cpu usage without caring about the threshold" class="wdcdcTitle">Can a workerpool declared in multiple routes still maintain its cpu usage without caring about the threshold</a> <a href="http://www.php.cn/wenda/176381.html" class="wdcdcCons">I'm hoping to find a node.js system with a workerpool to handle CPU intensive tasks, but I...</a> <div class="wdcdcInfo flexRow"> <div class="wdcdcileft"> <span class="wdcdciSpan"> From 2024-04-06 19:54:23</span> </div> <div class="wdcdciright flexRow"> <div class="wdcdcirdz flexRow ira"> <b class="wdcdcirdzi"></b>0 </div> <div class="wdcdcirpl flexRow ira"><b class="wdcdcirpli"></b>1</div> <div class="wdcdcirwatch flexRow ira"><b class="wdcdcirwatchi"></b>444</div> </div> </div> </div> </div> <div class="wdsyConLine wdsyConLine2"></div> <div class="wdsyConDiv flexRow wdsyConDiv1"> <div class="wdcdContent flexColumn"> <a href="http://www.php.cn/wenda/176368.html" target="_blank" title="Scatterplot points do not maintain values ​​when zooming in d3.js" class="wdcdcTitle">Scatterplot points do not maintain values ​​when zooming in d3.js</a> <a href="http://www.php.cn/wenda/176368.html" class="wdcdcCons">This is my first time using d3.js, so please bear with me. I implemented it as pure JavaSc...</a> <div class="wdcdcInfo flexRow"> <div class="wdcdcileft"> <span class="wdcdciSpan"> From 2024-04-06 18:16:26</span> </div> <div class="wdcdciright flexRow"> <div class="wdcdcirdz flexRow ira"> <b class="wdcdcirdzi"></b>0 </div> <div class="wdcdcirpl flexRow ira"><b class="wdcdcirpli"></b>1</div> <div class="wdcdcirwatch flexRow ira"><b class="wdcdcirwatchi"></b>403</div> </div> </div> </div> </div> <div class="wdsyConLine wdsyConLine2"></div> <div class="wdsyConDiv flexRow wdsyConDiv1"> <div class="wdcdContent flexColumn"> <a href="http://www.php.cn/wenda/176350.html" target="_blank" title="Show hidden side panels: checked" class="wdcdcTitle">Show hidden side panels: checked</a> <a href="http://www.php.cn/wenda/176350.html" class="wdcdcCons">I would like to have a navigation menu in the side panel with the ability to switch to vie...</a> <div class="wdcdcInfo flexRow"> <div class="wdcdcileft"> <span class="wdcdciSpan"> From 2024-04-06 15:49:33</span> </div> <div class="wdcdciright flexRow"> <div class="wdcdcirdz flexRow ira"> <b class="wdcdcirdzi"></b>0 </div> <div class="wdcdcirpl flexRow ira"><b class="wdcdcirpli"></b>1</div> <div class="wdcdcirwatch flexRow ira"><b class="wdcdcirwatchi"></b>319</div> </div> </div> </div> </div> <div class="wdsyConLine wdsyConLine2"></div> <div class="wdsyConDiv flexRow wdsyConDiv1"> <div class="wdcdContent flexColumn"> <a href="http://www.php.cn/wenda/176329.html" target="_blank" title="Should we use SSG to deploy dashboards created with Nuxt.js?" class="wdcdcTitle">Should we use SSG to deploy dashboards created with Nuxt.js?</a> <a href="http://www.php.cn/wenda/176329.html" class="wdcdcCons">We will develop a dashboard for internal use using Nuxt.js. Since this will be an internal...</a> <div class="wdcdcInfo flexRow"> <div class="wdcdcileft"> <span class="wdcdciSpan"> From 2024-04-06 13:17:44</span> </div> <div class="wdcdciright flexRow"> <div class="wdcdcirdz flexRow ira"> <b class="wdcdcirdzi"></b>0 </div> <div class="wdcdcirpl flexRow ira"><b class="wdcdcirpli"></b>1</div> <div class="wdcdcirwatch flexRow ira"><b class="wdcdcirwatchi"></b>493</div> </div> </div> </div> </div> <div class="wdsyConLine wdsyConLine2"></div> <div class="wdsyConDiv flexRow wdsyConDiv1"> <div class="wdcdContent flexColumn"> <a href="http://www.php.cn/wenda/176311.html" target="_blank" title="Electron gets AppData on preload" class="wdcdcTitle">Electron gets AppData on preload</a> <a href="http://www.php.cn/wenda/176311.html" class="wdcdcCons">How to get the preloaded AppData directory? Background.js[...]asyncfunctioncreateWindow(){...</a> <div class="wdcdcInfo flexRow"> <div class="wdcdcileft"> <span class="wdcdciSpan"> From 2024-04-06 11:05:31</span> </div> <div class="wdcdciright flexRow"> <div class="wdcdcirdz flexRow ira"> <b class="wdcdcirdzi"></b>0 </div> <div class="wdcdcirpl flexRow ira"><b class="wdcdcirpli"></b>1</div> <div class="wdcdcirwatch flexRow ira"><b class="wdcdcirwatchi"></b>417</div> </div> </div> </div> </div> <div class="wdsyConLine wdsyConLine2"></div> </div> </div> <div class="wzconZt" > <div class="wzczt-title"> <div>Related Topics</div> <a href="http://www.php.cn/faq/zt" target="_blank">More> </a> </div> <div class="wzcttlist"> <ul> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jszzbds"><img src="https://img.php.cn/upload/subject/202407/22/2024072214413954023.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="js regular expression" /> </a> <a target="_blank" href="http://www.php.cn/faq/jszzbds" class="title-a-spanl" title="js regular expression"><span>js regular expression</span> </a> </li> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jshqdqsj"><img src="https://img.php.cn/upload/subject/202407/22/2024072214282324693.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="js gets current time" /> </a> <a target="_blank" href="http://www.php.cn/faq/jshqdqsj" class="title-a-spanl" title="js gets current time"><span>js gets current time</span> </a> </li> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jszfcsz"><img src="https://img.php.cn/upload/subject/202407/22/2024072214253682490.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="js string to array" /> </a> <a target="_blank" href="http://www.php.cn/faq/jszfcsz" class="title-a-spanl" title="js string to array"><span>js string to array</span> </a> </li> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jsssmys"><img src="https://img.php.cn/upload/subject/202407/22/2024072214182727205.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="what does js mean" /> </a> <a target="_blank" href="http://www.php.cn/faq/jsssmys" class="title-a-spanl" title="what does js mean"><span>what does js mean</span> </a> </li> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jsscjddff"><img src="https://img.php.cn/upload/subject/202407/22/2024072214115932190.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="js method to delete node" /> </a> <a target="_blank" href="http://www.php.cn/faq/jsscjddff" class="title-a-spanl" title="js method to delete node"><span>js method to delete node</span> </a> </li> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jsjqzfc"><img src="https://img.php.cn/upload/subject/202407/22/2024072214115739127.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="js method to intercept string" /> </a> <a target="_blank" href="http://www.php.cn/faq/jsjqzfc" class="title-a-spanl" title="js method to intercept string"><span>js method to intercept string</span> </a> </li> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jsconcatpush"><img src="https://img.php.cn/upload/subject/202407/22/2024072214081060908.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="The difference between concat and push in JS" /> </a> <a target="_blank" href="http://www.php.cn/faq/jsconcatpush" class="title-a-spanl" title="The difference between concat and push in JS"><span>The difference between concat and push in JS</span> </a> </li> <li class="ul-li"> <a target="_blank" href="http://www.php.cn/faq/jsjqzfcdff"><img src="https://img.php.cn/upload/subject/202407/22/2024072214053585210.jpg?x-oss-process=image/resize,m_fill,h_145,w_220" alt="Introduction to the method of intercepting strings in js" /> </a> <a target="_blank" href="http://www.php.cn/faq/jsjqzfcdff" class="title-a-spanl" title="Introduction to the method of intercepting strings in js"><span>Introduction to the method of intercepting strings in js</span> </a> </li> </ul> </div> </div> </div> </div> <div class="phpwzright"> <div class="wzrOne"> <div class="wzroTitle">Popular Recommendations</div> <div class="wzroList"> <ul> <li> <div class="wzczzwzli"> <span class="layui-badge-dots wzrolr"></span> <a style="height: auto;" title="what does js mean" href="http://www.php.cn/faq/482163.html">what does js mean</a> </div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots wzrolr"></span> <a style="height: auto;" title="How to convert string to array in js?" href="http://www.php.cn/faq/461802.html">How to convert string to array in js?</a> </div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots wzrolr"></span> <a style="height: auto;" title="How to refresh the page using javascript" href="http://www.php.cn/faq/473330.html">How to refresh the page using javascript</a> </div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots wzrolr"></span> <a style="height: auto;" title="How to delete an item in js array" href="http://www.php.cn/faq/475790.html">How to delete an item in js array</a> </div> </li> <li> <div class="wzczzwzli"> <span class="layui-badge-dots wzrolr"></span> <a style="height: auto;" title="How to use sqrt function" href="http://www.php.cn/faq/415276.html">How to use sqrt function</a> </div> </li> </ul> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="wzrThree"> <div class="wzrthree-title"> <div>Popular Tutorials</div> <a target="_blank" href="http://www.php.cn/course.html">More> </a> </div> <div class="wzrthreelist swiper2"> <div class="wzrthreeTab swiper-wrapper"> <div class="check tabdiv swiper-slide" data-id="one">Related Tutorials <div></div></div> <div class="tabdiv swiper-slide" data-id="two">Popular Recommendations<div></div></div> <div class="tabdiv swiper-slide" data-id="three">Latest courses<div></div></div> </div> <ul class="one"> <li> <a target="_blank" href="http://www.php.cn/course/812.html" title="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/041/620debc3eab3f377.jpg" alt="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)"/> </a> <div class="wzrthree-right"> <a target="_blank" title="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)" href="http://www.php.cn/course/812.html">The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)</a> <div class="wzrthreerb"> <div>1417456 <b class="kclbcollectb"></b></div> <div class="courseICollection" data-id="812"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/74.html" title="PHP introductory tutorial one: Learn PHP in one week" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/068/6253d1e28ef5c345.png" alt="PHP introductory tutorial one: Learn PHP in one week"/> </a> <div class="wzrthree-right"> <a target="_blank" title="PHP introductory tutorial one: Learn PHP in one week" href="http://www.php.cn/course/74.html">PHP introductory tutorial one: Learn PHP in one week</a> <div class="wzrthreerb"> <div>4258634 <b class="kclbcollectb"></b></div> <div class="courseICollection" data-id="74"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/286.html" title="JAVA Beginner's Video Tutorial" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/068/62590a2bacfd9379.png" alt="JAVA Beginner's Video Tutorial"/> </a> <div class="wzrthree-right"> <a target="_blank" title="JAVA Beginner's Video Tutorial" href="http://www.php.cn/course/286.html">JAVA Beginner's Video Tutorial</a> <div class="wzrthreerb"> <div>2481756 <b class="kclbcollectb"></b></div> <div class="courseICollection" data-id="286"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/504.html" title="Little Turtle's zero-based introduction to learning Python video tutorial" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/068/62590a67ce3a6655.png" alt="Little Turtle's zero-based introduction to learning Python video tutorial"/> </a> <div class="wzrthree-right"> <a target="_blank" title="Little Turtle's zero-based introduction to learning Python video tutorial" href="http://www.php.cn/course/504.html">Little Turtle's zero-based introduction to learning Python video tutorial</a> <div class="wzrthreerb"> <div>504154 <b class="kclbcollectb"></b></div> <div class="courseICollection" data-id="504"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/2.html" title="PHP zero-based introductory tutorial" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/068/6253de27bc161468.png" alt="PHP zero-based introductory tutorial"/> </a> <div class="wzrthree-right"> <a target="_blank" title="PHP zero-based introductory tutorial" href="http://www.php.cn/course/2.html">PHP zero-based introductory tutorial</a> <div class="wzrthreerb"> <div>844494 <b class="kclbcollectb"></b></div> <div class="courseICollection" data-id="2"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> </ul> <ul class="two" style="display: none;"> <li> <a target="_blank" href="http://www.php.cn/course/812.html" title="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/041/620debc3eab3f377.jpg" alt="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)"/> </a> <div class="wzrthree-right"> <a target="_blank" title="The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)" href="http://www.php.cn/course/812.html">The latest ThinkPHP 5.1 world premiere video tutorial (60 days to become a PHP expert online training course)</a> <div class="wzrthreerb"> <div >1417456 times of learning</div> <div class="courseICollection" data-id="812"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/286.html" title="JAVA Beginner's Video Tutorial" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/068/62590a2bacfd9379.png" alt="JAVA Beginner's Video Tutorial"/> </a> <div class="wzrthree-right"> <a target="_blank" title="JAVA Beginner's Video Tutorial" href="http://www.php.cn/course/286.html">JAVA Beginner's Video Tutorial</a> <div class="wzrthreerb"> <div >2481756 times of learning</div> <div class="courseICollection" data-id="286"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/504.html" title="Little Turtle's zero-based introduction to learning Python video tutorial" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/068/62590a67ce3a6655.png" alt="Little Turtle's zero-based introduction to learning Python video tutorial"/> </a> <div class="wzrthree-right"> <a target="_blank" title="Little Turtle's zero-based introduction to learning Python video tutorial" href="http://www.php.cn/course/504.html">Little Turtle's zero-based introduction to learning Python video tutorial</a> <div class="wzrthreerb"> <div >504154 times of learning</div> <div class="courseICollection" data-id="504"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/901.html" title="Quick introduction to web front-end development" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/067/64be28a53a4f6310.png" alt="Quick introduction to web front-end development"/> </a> <div class="wzrthree-right"> <a target="_blank" title="Quick introduction to web front-end development" href="http://www.php.cn/course/901.html">Quick introduction to web front-end development</a> <div class="wzrthreerb"> <div >215345 times of learning</div> <div class="courseICollection" data-id="901"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/234.html" title="Master PS video tutorials from scratch" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/068/62611f57ed0d4840.jpg" alt="Master PS video tutorials from scratch"/> </a> <div class="wzrthree-right"> <a target="_blank" title="Master PS video tutorials from scratch" href="http://www.php.cn/course/234.html">Master PS video tutorials from scratch</a> <div class="wzrthreerb"> <div >878429 times of learning</div> <div class="courseICollection" data-id="234"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> </ul> <ul class="three" style="display: none;"> <li> <a target="_blank" href="http://www.php.cn/course/1648.html" title="[Web front-end] Node.js quick start" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/067/662b5d34ba7c0227.png" alt="[Web front-end] Node.js quick start"/> </a> <div class="wzrthree-right"> <a target="_blank" title="[Web front-end] Node.js quick start" href="http://www.php.cn/course/1648.html">[Web front-end] Node.js quick start</a> <div class="wzrthreerb"> <div >6498 times of learning</div> <div class="courseICollection" data-id="1648"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/1647.html" title="Complete collection of foreign web development full-stack courses" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/067/6628cc96e310c937.png" alt="Complete collection of foreign web development full-stack courses"/> </a> <div class="wzrthree-right"> <a target="_blank" title="Complete collection of foreign web development full-stack courses" href="http://www.php.cn/course/1647.html">Complete collection of foreign web development full-stack courses</a> <div class="wzrthreerb"> <div >5098 times of learning</div> <div class="courseICollection" data-id="1647"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/1646.html" title="Go language practical GraphQL" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/067/662221173504a436.png" alt="Go language practical GraphQL"/> </a> <div class="wzrthree-right"> <a target="_blank" title="Go language practical GraphQL" href="http://www.php.cn/course/1646.html">Go language practical GraphQL</a> <div class="wzrthreerb"> <div >4282 times of learning</div> <div class="courseICollection" data-id="1646"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/1645.html" title="550W fan master learns JavaScript from scratch step by step" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/067/662077e163124646.png" alt="550W fan master learns JavaScript from scratch step by step"/> </a> <div class="wzrthree-right"> <a target="_blank" title="550W fan master learns JavaScript from scratch step by step" href="http://www.php.cn/course/1645.html">550W fan master learns JavaScript from scratch step by step</a> <div class="wzrthreerb"> <div >635 times of learning</div> <div class="courseICollection" data-id="1645"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> <li> <a target="_blank" href="http://www.php.cn/course/1644.html" title="Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours" class="wzrthreelaimg"> <img src="https://img.php.cn/upload/course/000/000/067/6616418ca80b8916.png" alt="Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours"/> </a> <div class="wzrthree-right"> <a target="_blank" title="Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours" href="http://www.php.cn/course/1644.html">Python master Mosh, a beginner with zero basic knowledge can get started in 6 hours</a> <div class="wzrthreerb"> <div >21799 times of learning</div> <div class="courseICollection" data-id="1644"> <b class="nofollow small-nocollect"></b> </div> </div> </div> </li> </ul> </div> <script> var mySwiper = new Swiper('.swiper2', { autoplay: false,//可选选项,自动滑动 slidesPerView : 'auto', }) $('.wzrthreeTab>div').click(function(e){ $('.wzrthreeTab>div').removeClass('check') $(this).addClass('check') $('.wzrthreelist>ul').css('display','none') $('.'+e.currentTarget.dataset.id).show() }) </script> </div> <div class="wzrFour"> <div class="wzrfour-title"> <div>Latest Downloads</div> <a href="http://www.php.cn/xiazai">More> </a> </div> <script> $(document).ready(function(){ var sjyx_banSwiper = new Swiper(".sjyx_banSwiperwz",{ speed:1000, autoplay:{ delay:3500, disableOnInteraction: false, }, pagination:{ el:'.sjyx_banSwiperwz .swiper-pagination', clickable :false, }, loop:true }) }) </script> <div class="wzrfourList swiper3"> <div class="wzrfourlTab swiper-wrapper"> <div class="check swiper-slide" data-id="onef">Web Effects <div></div></div> <div class="swiper-slide" data-id="twof">Website Source Code<div></div></div> <div class="swiper-slide" data-id="threef">Website Materials<div></div></div> <div class="swiper-slide" data-id="fourf">Front End Template<div></div></div> </div> <ul class="onef"> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="jQuery enterprise message form contact code" href="http://www.php.cn/xiazai/js/8071">[form button] jQuery enterprise message form contact code</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="HTML5 MP3 music box playback effects" href="http://www.php.cn/xiazai/js/8070">[Player special effects] HTML5 MP3 music box playback effects</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="HTML5 cool particle animation navigation menu special effects" href="http://www.php.cn/xiazai/js/8069">[Menu navigation] HTML5 cool particle animation navigation menu special effects</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="jQuery visual form drag and drop editing code" href="http://www.php.cn/xiazai/js/8068">[form button] jQuery visual form drag and drop editing code</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="VUE.JS imitation Kugou music player code" href="http://www.php.cn/xiazai/js/8067">[Player special effects] VUE.JS imitation Kugou music player code</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="Classic html5 pushing box game" href="http://www.php.cn/xiazai/js/8066">[html5 special effects] Classic html5 pushing box game</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="jQuery scrolling to add or reduce image effects" href="http://www.php.cn/xiazai/js/8065">[Picture special effects] jQuery scrolling to add or reduce image effects</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a target="_blank" title="CSS3 personal album cover hover zoom effect" href="http://www.php.cn/xiazai/js/8064">[Photo album effects] CSS3 personal album cover hover zoom effect</a> </div> </li> </ul> <ul class="twof" style="display:none"> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8328" title="Home Decor Cleaning and Repair Service Company Website Template" target="_blank">[Front-end template] Home Decor Cleaning and Repair Service Company Website Template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8327" title="Fresh color personal resume guide page template" target="_blank">[Front-end template] Fresh color personal resume guide page template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8326" title="Designer Creative Job Resume Web Template" target="_blank">[Front-end template] Designer Creative Job Resume Web Template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8325" title="Modern engineering construction company website template" target="_blank">[Front-end template] Modern engineering construction company website template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8324" title="Responsive HTML5 template for educational service institutions" target="_blank">[Front-end template] Responsive HTML5 template for educational service institutions</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8323" title="Online e-book store mall website template" target="_blank">[Front-end template] Online e-book store mall website template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8322" title="IT technology solves Internet company website template" target="_blank">[Front-end template] IT technology solves Internet company website template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8321" title="Purple style foreign exchange trading service website template" target="_blank">[Front-end template] Purple style foreign exchange trading service website template</a> </div> </li> </ul> <ul class="threef" style="display:none"> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3078" target="_blank" title="Cute summer elements vector material (EPS PNG)">[PNG material] Cute summer elements vector material (EPS PNG)</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3077" target="_blank" title="Four red 2023 graduation badges vector material (AI EPS PNG)">[PNG material] Four red 2023 graduation badges vector material (AI EPS PNG)</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3076" target="_blank" title="Singing bird and cart filled with flowers design spring banner vector material (AI EPS)">[banner picture] Singing bird and cart filled with flowers design spring banner vector material (AI EPS)</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3075" target="_blank" title="Golden graduation cap vector material (EPS PNG)">[PNG material] Golden graduation cap vector material (EPS PNG)</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3074" target="_blank" title="Black and white style mountain icon vector material (EPS PNG)">[PNG material] Black and white style mountain icon vector material (EPS PNG)</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3073" target="_blank" title="Superhero silhouette vector material (EPS PNG) with different color cloaks and different poses">[PNG material] Superhero silhouette vector material (EPS PNG) with different color cloaks and different poses</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3072" target="_blank" title="Flat style Arbor Day banner vector material (AI+EPS)">[banner picture] Flat style Arbor Day banner vector material (AI+EPS)</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/sucai/3071" target="_blank" title="Nine comic-style exploding chat bubbles vector material (EPS+PNG)">[PNG material] Nine comic-style exploding chat bubbles vector material (EPS+PNG)</a> </div> </li> </ul> <ul class="fourf" style="display:none"> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8328" target="_blank" title="Home Decor Cleaning and Repair Service Company Website Template">[Front-end template] Home Decor Cleaning and Repair Service Company Website Template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8327" target="_blank" title="Fresh color personal resume guide page template">[Front-end template] Fresh color personal resume guide page template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8326" target="_blank" title="Designer Creative Job Resume Web Template">[Front-end template] Designer Creative Job Resume Web Template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8325" target="_blank" title="Modern engineering construction company website template">[Front-end template] Modern engineering construction company website template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8324" target="_blank" title="Responsive HTML5 template for educational service institutions">[Front-end template] Responsive HTML5 template for educational service institutions</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8323" target="_blank" title="Online e-book store mall website template">[Front-end template] Online e-book store mall website template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8322" target="_blank" title="IT technology solves Internet company website template">[Front-end template] IT technology solves Internet company website template</a> </div> </li> <li> <div class="wzrfourli"> <span class="layui-badge-dots wzrflr"></span> <a href="http://www.php.cn/xiazai/code/8321" target="_blank" title="Purple style foreign exchange trading service website template">[Front-end template] Purple style foreign exchange trading service website template</a> </div> </li> </ul> </div> <script> var mySwiper = new Swiper('.swiper3', { autoplay: false,//可选选项,自动滑动 slidesPerView : 'auto', }) $('.wzrfourlTab>div').click(function(e){ $('.wzrfourlTab>div').removeClass('check') $(this).addClass('check') $('.wzrfourList>ul').css('display','none') $('.'+e.currentTarget.dataset.id).show() }) </script> </div> </div> </div> <div class="phpFoot"> <div class="phpFootIn"> <div class="phpFootCont"> <div class="phpFootLeft"> <dl> <dt> <a href="http://www.php.cn/about/xieyi.html" rel="nofollow" target="_blank" title="About us" class="cBlack">About us</a> <a href="http://www.php.cn/about/yinsi.html" rel="nofollow" target="_blank" title="Disclaimer" class="cBlack">Disclaimer</a> <a href="http://www.php.cn/update/article_0_1.html" target="_blank" title="Sitemap" class="cBlack">Sitemap</a> <div class="clear"></div> </dt> <dd class="cont1">php.cn:Public welfare online PHP training,Help PHP learners grow quickly!</dd> </dl> </div> </div> </div> </div> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1731458393"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all'/> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> </body> </html>