I need to flip div to hover

I am using flip jquery plugin. I would like to flip the map (div), after it has ended, to flip, immediately to return. This is what I tried

$("#flipbox").bind("hover",function(){ $(this).flip({ direction:'tb', onEnd: function() { $(this).revertFlip(); console.log('when the animation has already ended'); } }) } 
+4
source share
2 answers

Try the following: http://jsfiddle.net/netwire88/NAbZT/16/

 $(document).on("click", ".flipbox-forward", function(e) { e.preventDefault(); var $this = $(this); $this.flip({ direction: $this.data("direction"), color: $this.data("color"), content: $this.data("title"), onBefore: function() { $this.removeClass('flipbox-forward'); $this.addClass('flipbox-revert'); } }) }); $(document).on("click", ".flipbox-revert", function(e) { e.preventDefault(); var $this = $(this); $this.revertFlip(); $this.removeClass('flipbox-revert'); $this.addClass('flipbox-forward'); });​ 
+1
source

try to fool. Make 2 different classes,

then use the mouseenter event to change the class and change it using the mouseleave event.

at least this is the stuff that I do when I'm close to my deadlines: P

0
source

Source: https://habr.com/ru/post/1383629/


All Articles