Total Page Preview:   000000000174

What is fadeTo() in jQuery ?

 fadeTo() in jQuery

The fadeTo() method in jQuery is used to gradually change the opacity of selected elements to a specified level. Unlike fadeIn() and fadeOut(), fadeTo() allows you to set the target opacity directly, providing more control over the fading effect. It takes two parameters: the duration of the fading effect and the target opacity level.

Here's an example demonstrating the use of fadeTo():
In this example, there's a box element with the class "box." When the box is clicked, the fadeTo(1000, 0.5) method is called. This means that the box will fade to an opacity of 0.5 (50%) over a duration of 1000 milliseconds (1 second). After the fade completes, an alert is shown with the message "Fade to 0.5 opacity!"
You can customize the duration and target opacity according to your requirements. The fadeTo() method provides a flexible way to control the fading effect with precise opacity settings.
 
 
 
 
 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments