2016-08-03 3 views
0

여기 내 피들 link입니다.라인 입력 애니메이션 입력

jQuery('input').focusin(function(){ 
    window.setTimeout(function() { 
    jQuery('input').addClass('animatedBottomBorder'); 
    }, 150); 
    window.setTimeout(function() { 
    jQuery('input').addClass('animatedLeftBorder'); 
    }, 300); 
    window.setTimeout(function() { 
    jQuery('input').addClass('animatedTopBorder'); 
    }, 450); 
    window.setTimeout(function() { 
    jQuery('input').addClass('animatedRightBorder'); 
    }, 600); 
}); 
jQuery('input').focusout(function(){ 
    jQuery('.searchTextField').removeClass('animatedBottomBorder'); 
    jQuery('.searchTextField').removeClass('animatedLeftBorder'); 
    jQuery('.searchTextField').removeClass('animatedTopBorder'); 
    jQuery('.searchTextField').removeClass('animatedRightBorder'); 
}); 

포커스가있는 이벤트에서는 테두리가 흐리기 시작하고 포커스 아웃 이벤트 테두리가 사라집니다.

하지만 줄이 움직이는 동안 꽤 빨리 움직여야합니다. 이제는 페이드 모션으로로드되지만 움직이는 모션으로 나타나기를 바랍니다.

+0

클릭하고 나가는 동안 애니메이션이 빨라지 길 원하십니까? –

+0

예 빨리 처리 할 수 ​​있지만 주요 문제는 페이드 애니메이션을 움직이는 애니메이션으로 변경하려는 것입니다. @DebakantMohanty – aidadev

+0

대신 css3 애니메이션을 사용하는 것이 더 간단하지 않습니까? Le : 키 프레임 애니메이션 사용 –

답변

0

는 아래의 코드를 시도해보십시오 :이 도움이 될 것입니다

jQuery('input').focusin(function(){ 
    window.setTimeout(function() { 
    jQuery('input').css({"border-right-color": 'blue'}).animate({ 
     borderWidth: 4 
    }, 500, 'swing'); 
    }, 150); 
    window.setTimeout(function() { 
    jQuery('input').css({"border-bottom-color": 'green'}).animate({ 
     borderWidth: 4 
    }, 500, 'swing'); 
    }, 300); 
    window.setTimeout(function() { 
    jQuery('input').css({"border-left-color": 'black'}).animate({ 
     borderWidth: 4 
    }, 500, 'swing'); 
    }, 450); 
    window.setTimeout(function() { 
    jQuery('input').css({"border-top-color": 'red'}).animate({ 
     borderWidth: 4 
    }, 500, 'swing'); 
    }, 600); 
}); 

희망!

+0

코드를 보내 주셔서 감사합니다. 하지만 다시 페이드 모드입니다. 테두리 선이 흰색으로 채워지고 선을 그어주는 효과가 생기길 바랍니다. 어떤 아이디어? @ 데바 칸트 모 항티 – aidadev