I’m struggling with trying to get this piece of code working properly. I’m moving an element with
$("#element").hide("slide", { direction: "right" }, 200);
Which works just great, but I need to reset it back to the original position before the animation, once the animation is complete so that it will animate again next time.
Any help on this would be greatly appreciated.
var position = jQuery("#"+that.currentIconSlide).find('.slideInner').position();
jQuery("#"+that.currentIconSlide).find(".slideInner").hide("slide", { direction: "right" }, 200, function(){
jQuery(this).css({"left":position.left,"top":position.top}).parent().hide();
});
JS Fiddle – http://jsfiddle.net/zalun/E4mz9/
1 Answer