Not sure about your top mount idea (I can not picture it in my head) can you draw up or take a pic of you idea?
For the sides, I would attach them to the trailer, and let them slide in and out of the truck bead as you turn (make them long). I would in the truck make a bracket that will hold the material tight up to the truck, but still allow the in/out sliding. I spring to hold it tight in (to the front of the truck) might not be a bad idea.
For the top, attach it to the trailer to so that you can attach the sides and top to each other. I would make the top in two overlapping pieces. the back one would run from the trailer as close to the truck as possible (take turning into consideration). The second piece would be attached to the truck and overlap the back (on top so air does not get under). I would make it so that when turned there is no gap in the top pieces.
Example: put one hand on your other, fingers overlapping, rotate one. this is what the top should be able to do.
__________________
|