Creating a seamless transition between elements