I would like to provide shake effect for the text inside a textbox when the validation fails. Can some one suggest the jQuery code for the same.

Here's a link that shows the exact requirement. Click here

Thank You.

有帮助吗?

解决方案

may be doing something like

function shakeText(selector){
    $(selector).animate({'padding-left' : '5'} , 1000 , function(){
        $(selector).animate({'padding-left' : '0'} , 1000)}
);

}
shakeText('#element')

here is a jsfiddle

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top