This is an extremely common effect.
And my recent job requires such effect,
so I decided to write an API for it.
This API is called Carousel, for it's the common name for this effect.
To use Carousel,
you have to first create a "base" Carousel object,
and then create one/some "rotating" Pony object/objects.
It's usage is pretty simple, taking a look in the souce code would help you get the idea.