Easy.
To start spinning in this pen, the map must receive a new css.
If the number that was created by the rnd () function matches the previous one, the css of the element does not change, so the browser does not start the animation, it thinks that it has already been played (and that was).
" ", SAME, - DOM (, ?) , . "" .
$element.attr('style', null);
setTimeout(function(){
$element.css("transition", "0.6s");
$element.css("transform", "rotateY("180deg)");
}, 100);
.