Sure you can call that swinging.
make regular movements forwards and backwards or from one side to another while hanging from a particular point.
That would seem to fit here and its certainly not the case that the object must be suspended from above. Doors can swing open, for example.
If you want to tell your child to stop swinging on the bed, normal ...