Q:

Effect of shaking the browser screen by javascript

How do I make the effect of shaking the browser screen by javascript?
On googling, I found codes involving window.moveBy(x,y) which don't seem to work. I tried them.
Any library or piece of code which would help me implement this kind of effect/animation?

A:

You likely won't be able to move the actual browser window as that functionality is blocked in modern browsers. However, you can "shake" the contents of the window by animating the body left/right/up/down relative to the window.

