JSFiddle - React, Tailwind, and code Playground
HTML
Try hovering:<br>
<div id="cssed">This uses .css()</div>
<div id="animated">This uses .animate()</div>
CSS
#cssed, #animated {
background:#F00;
padding:220px;
margin:10px;
float:left;
margin-top:150;
}
JavaScript
$('#cssed').hover(
function() {
$('#cssed').css({
marginTop: 20
});
},
function() {
$('#cssed').css({
marginTop: 10
});
}
);
$('#animated').hover(
function() {
$('#animated').animate({
marginTop:20
});
console.log('hi');
},
function() {
$('#animated').animate({
marginTop:10
});
}
);