Javascript examples for jQuery:Fade
Fade the <div> element to an opacity of "0.2" slowly
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("div").fadeTo("slow", 0.2); });/*from w w w . j a v a 2s . co m*/ </script> </head> <body> <div style="width:80px;height:80px;background-color:red;"></div> </body> </html>