English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Cette exemple explique l'utilisation des méthodes fadein et fadeout dans jQuery. Partageons cela pour que tout le monde puisse en bénéficier, voici les détails :
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <style type="text/css"> *{font-size:12px;} div{width:600px;margin:auto;} #control{background-color:gold;padding:10px;margin-bottom:10px;} </style> <script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $("#btnfadeIn").click(function () { $("#message").fadeIn(1000); }); $("#btnfadeOut").click(function () {}} $("#message").fadeOut(1000); }); }); </script> </head> <body> <div id="control"> <input id="btnfadeIn" type="button" value="Fade in div"> /> <input id="btnfadeOut" type="button" value="Fade out div"> /> </div> <div id="message"> Difference between mouseover and mouseenter: div contains div. See note. It is related to event bubbling. <br /> The mouseover event will be triggered whether the mouse pointer passes through the selected element or its child elements <br> The difference between mouseover and mouseenter: div contains div. See note. It is related to event bubbling. <br /> The mouseenter event will be triggered only when the mouse pointer passes through the selected element (passing through child elements will not trigger the event). </div> </body> </html>
Readers who are interested in more about jQuery-related content can check the special topics on this site: 'Summary of jQuery DOM node operation methods', 'Summary of jQuery element operation skills', 'Summary of jQuery common event usage and skills', 'Summary of jQuery common plugins and usage', 'Summary of jQuery extension skills', 'Summary of jQuery table (table) operation skills', 'Summary of jQuery common classic effects', and 'Summary of jQuery selector usage'.
I hope the content described in this article will be helpful to everyone in jQuery programming design.
Statement: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume any relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#oldtoolbag.com (when sending an email, please replace # with @ to report abuse, and provide relevant evidence. Once verified, this site will immediately delete the infringing content.)