jQuery Plugin To Animate Color Of Element Border - BorderColorAnimate

jQuery Plugin To Animate Color Of Element Border - BorderColorAnimate
File Size: 6.58 KB
Views Total:
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

BorderColorAnimate is a lightweight jQuery plugin that lets you animate the border color of a specific container element using HTML5 window.requestAnimationFrame API.

How to use it:

1. Include jQuery library and the jQuery BorderColorAnimate plugin at the bottom of the webpage.

<script src="//code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="bordercoloranimate.min.js"></script>

2. Set the initial border color of your element.

.myElement {
  border: 10px solid #66ff1a;
}

3. Active the plugin and set the target color you'd like to animate to.

$('.myElement').BorderColorAnimate('#ff1a4b');

4. Set the animation speed when transitioning between colors.

$('.myElement')..BorderColorAnimate('#ff1a4b', 400)

5. Execute a callback when the animation is finished.

$('.myElement')..BorderColorAnimate('#ff1a4b', 400, function(){
  $(this).BorderColorAnimate('#66ff1a');
})

Change log:

2017-03-22


This awesome jQuery plugin is developed by payalord. For more Advanced Usages, please check the demo page or visit the official website.