This is the book
Amazons read this book thing covers the first two pages of it but it doesnt quite get to the animation part
Ok, you need the texture to be a ramp, so part colour, part black. You need to go to the place2D texture node for the ramp, go to the first frame and right click over the first field in the translate frame attributes (this is the field for the U coordinates position) and choose set key
Move to the frame where you want the portal to be closed completely and change the 0 in the field to 1 and set another key
If you then press the arrow next to that field you may have to fiddle with the settings
You will also have to organise the Uvs for it to work
Because of what you are doing you may be better off connecting the ramp to the transparacny of the ocean shader, depending what effect you want to create
Im sorry I cant help more but im not that experianced with it. It requires a lot of trial and error. Maybe some one else can help a bit more?