Before using jQuery to complete the fade-in and fade-out effect, let's first get to know some codes:
in
Then let's put the above code into the overall code to see the effect The complete code is as follows <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Wellfancy</title> <style> div { margin: 10px; padding: 10px; width: 100px; display: none; } </style> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> </head> <body> <button>Fade-in effect</button> <button>Fade out effect</button> <button>Fade in and out switch</button> <button>Modify transparency</button> <div> <img src="images/1.jpg" style="width: 280px;"> </div> <script> $(function() { $("button").eq(0).click(function() { $("div").fadeIn(1000); }) $("button").eq(1).click(function() { $("div").fadeOut(1000); }) $("button").eq(2).click(function() { $("div").fadeToggle(1000); }); $("button").eq(3).click(function() { $("div").fadeTo(1000, 0.5); }); }); </script> </body> </html> The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: MySQL 8.0.18 stable version released! Hash Join is here as expected
>>: Detailed tutorial on migrating the home directory to a new partition under Ubuntu
Create table data CREATE TABLE `praise_info` ( `i...
This article shares the specific code of Vue to a...
1. Download the MySQL 5.7.11 zip installation pac...
Original article: Ultimate IE6 Cheatsheet: How To...
Linear-gradient background-image: linear-gradient...
This article introduces the sample code of CSS to...
Table of contents Preparation Deployment process ...
Preface Crond is a scheduled execution tool under...
Preface Nginx 's built-in module supports lim...
Regarding some MySQL specifications, some compani...
Web Services are concerned with application-to-ap...
I encountered a problem when I turned on my lapto...
One trick for dealing with this type of error is t...
How to debug a page on iPad? When using iOS 5, you...
Table of contents 1. LVS load balancing 2. Basic ...