I have this animation that makes some buttons on screen 'beat'. It works fine exept one thing, the animation is too 'sharp' and not smooth, how can I smooth it?
function myFunction() { setInterval(function () { tstFnc(); }, 1000); } var flag = true; function tstFnc() { var numM = Math.floor((Math.random() * 10) + 1); var stringM = '#mgf_main' + numM + ' img'; $(stringM).animate({ width: '80px', height: '80px' }, 150, function () { $(stringM).animate({ width: '68px', height: '68px' }, 150, function () { // nothing }); }); };