Make a piñata float

Hi all, I"m fairly new to javascript, and I would like someone’s assistance with a project that I"m starting. I would like to make a piñata float, and I’m sure that there’s a way to recreate a motion with Javascript, but I’m just not sure where to start. Any tips?

you mean move like when someone is holding the piñata to be broken? if so I think that you should look into a javascript framework that has effects but I am not quite sure you will be able to do it with pure javascript, if yotell me what exactly is the piñata supposed to do I might be able to give you some ideas.