I want this svg drawing to go up when it's clicked and then go down when it's clicked again, and also go up and down a little when it's hovered. I managed to do the hover part and to make it go up once it's clicked, but I cant make it go down when it's clicked again. I figured using "toggle" instead of "click" would work:
$('#globoamarillo1').click(function() {
$("#globoamarillo1").animate({top: '-=200px'}, 1000);
(changed to)
$('#globoamarillo1').toggle(function() {
$("#globoamarillo1").animate({top: '-=200px'}, 1000);
But when I use that the drawing goes crazy and flies out of the picture instantly.
https://jsfiddle.net/vqvLyctj/3/
So how can I make it go down when it's clicked again?