JSFiddle - React, Tailwind, and code Playground
by maccman
HTML
<div class="element"></div>
CSS
body { margin: 20px; }
.element {
width: 100px;
height: 100px;
background: red;
}
JavaScript
var defaults = {
duration: 400,
easing: ''
};
$.fn.transition = function (properties, options) {
options = $.extend({}, defaults, options);
properties['webkitTransition'] = 'all ' + options.duration + 'ms ' + options.easing;
$(this).css(properties);
};
setTimeout(function(){
$('.element').transition({marginLeft: 100});
}, 1000);