Step on the switch to make the orb fall into the slot. This will activate a platform that Link can move on. Again, step on the switch, but this time move off the switch just before the orb reaches the end of the first platform. It should then roll down to the slot, and Link can move on.
On the final part, Link again has to stand on the floor switch, but time stepping off the switch so the floor will spring the ball into the slot. Take the moving plaftorm across.
Once you make it across, grab a barrel with magnesis and move it onto the floor switch which you just used. This should position the floor back to its tilted position which Link can run up and grab the treasure chest.