自制让dom元素抖动的插件方法

如何让输入框在输入错误的时候抖动产生一种输入错误的视觉效果呢?

'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);
        }

猜你喜欢

转载自201702111255.iteye.com/blog/2379426