Home > Web Front-end > JS Tutorial > The use and basics of jQuery callback function (callback)_jquery

The use and basics of jQuery callback function (callback)_jquery

WBOY
Release: 2016-05-16 16:12:52
Original
1330 people have browsed it

Let’s post the code first

Copy code The code is as follows:



   
       
       
       
   

   
       
       

        <script> <br>             $(document).ready(function(){<br>               $("button").click(function(){<br>                 var div=$(".box");<br>                 div.animate({height:'200px',opacity:'0.4'},"slow");<br>                 div.animate({width:'200px',opacity:'0.8'},"slow");<br>                 div.animate({height:'100px',opacity:'0.4'},"slow");<br>                 div.animate({width:'100px',opacity:'0.8'},"slow");<br>                 div.animate({right:'100px',opacity:'0.8'},"slow");<br>                 div.animate({bottom:'100px',opacity:'0.8'},"slow");<br>                 div.animate({left:'100px',opacity:'0.8'},"slow");<br>                 div.animate({top:'100px',opacity:'0.8'},"slow",function(){<br>                     alert("The paragraph is over");<br>                 });<br>               });<br>             });<br>         </script>
        <script><br>             $(document).ready(function(){<br>                 $("button").click(function(){<br>                     var div=$(".box");<br>                         div.animate({height:'300px',opacity:'0.4'},"slow");<br>                         div.animate({width:'300px',opacity:'0.8'},"slow");<br>                         div.animate({height:'100px',opacity:'0.4'},"slow");<br>                         div.animate({width:'100px',opacity:'0.8'},"slow",function(){<br>                     alert("The paragraph is over");<br>                     });<br>                     });<br>                 });<br>             });<br>         </script>
   

所谓的回调函数,其实就是在 speed 或 duration 参数可以设置许多不同的值,比如 "slow", "fast", "normal" 或毫秒  后面再添加函数,显示相对应的内容,以提示网民

小伙伴们对jQuery回调函数是否有了新的认识了呢,希望本文能给大家一些帮助。

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template