Skip to content

Edixs/ButtonFadeAnimation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Button Fade Animation This repository contains JavaScript code to implement a fade-in fade-out animation effect for a button.

Description The JavaScript code provided in index.js demonstrates how to create a button and implement a fade-in fade-out animation effect when the button is clicked. The animation effect is achieved by gradually changing the opacity of the button element.

Usage To use this animation effect:

Include the index.js file in your project. Ensure you have an HTML file with a button element that you want to apply the animation effect to. Add an id attribute to your button element with the value "btn". When the button is clicked, it triggers the fade-out animation first and then the fade-in animation. Implementation The JavaScript code defines two functions:

fadeOut(element, duration, callback): This function animates the specified HTML element to gradually fade out over a specified duration in milliseconds. Optionally, you can provide a callback function to execute once the fade-out animation is complete.

fadeIn(element, duration): This function animates the specified HTML element to gradually fade in over a specified duration in milliseconds.

Example You can see the animation effect in action by including the provided index.js file in your project and ensuring that you have an HTML button element with the id "btn".

Credits This code was created by [Edixs].

Contributing Contributions are welcome! Feel free to submit pull requests or open issues if you have any suggestions or improvements.

License This project is licensed under the [License Edixs] License - see the LICENSE file for details.

About

Button Fade Animation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published