Add support for passing options, loop and delay for animation.