Trying to prevent a "reversing" css transition when un-hovering the element. To keep it in its "forward" position and repeat the "forward" transition upon hovering again is the goal.
This is what has been attempted:
Using jQuery
jQuery(document).ready(function() {
jQuery("#fancy_icon-51-66").mouseleave(function () {
jQuery(this).removeClass("start-transition");
jQuery(this).addClass("stop-transition");
});
jQuery("#fancy_icon-51-66").mouseenter(function () {
jQuery(this).removeClass("stop-transition");
jQuery(this).addClass("start-transition");
});
});
With CSS
.stop-transition {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
transition: none !important;
}
.start-transition {
-webkit-transition: transform 0.5s !important;
-moz-transition: transform 0.5s !important;
-o-transition: transform 0.5s !important;
transition: transform 0.5s !important;
}
The transition itself involves a transform -> rotate 360°.
As a beginner seeking help to accomplish this, any suggestions are greatly appreciated! Thank you!