入力親のマージン権を取得するために親クラスを配置するこの関数があります。親の動作を少し変更して、この「$(this).parent().addClass('cooling');
」を「」
に置き換えたいのですが$(this).parent().animate({ marginRight: "200px" }, slow );
、ぼかしの際にそのアニメーションマージンを削除する方法がわかりません。誰かが私を助けることができれば...
function inputWidth(){
$('input[type=text]')
.focus(function() {
if ($(this).val().length > 21) {
$(this).data('default', $(this).data('default') || $(this).width());
$(this).stop().animate({width: 300}, 'slow');
$(this).parent().addClass('cooling');
//$(this).parent().animate({ marginRight: "200px" }, slow );
}
})
.blur(function() { /* lookup the original width */
$(this).stop().animate({width:
$(this).data('default')},'fast');
$(this).parent().removeClass('cooling');
});
};