Self-made plug-in method to make dom elements shake

How to make the input box shake when input is wrong to produce a visual effect of input error?

'DOMShake' : function(o){
            var $panel = $(o);
            $panel.stop()
                .animate({ left: "-10px" }, 100).animate({ left: "10px" }, 100)
                .animate({ left: "-10px" }, 100).animate({ left: "10px" }, 100)
                .animate({ left: "0px" }, 100);
        }

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326604733&siteId=291194637