2014-05-21 4 views
0

텍스트 상자를 덮는 div를 클릭하고 클릭하면 경계로 튀어 오르게되는 Jquery Animation이 있습니다. 그러나 나는 약간의 remakes 후 애니메이션 뛰어 오르는 것처럼 보일 수 없다. 어떤 아이디어?제대로 작동하도록 애니메이션을 가져올 수 없습니다.

자바 스크립트

function moveup(title,text){ 
$(title).animate{ 
if (text).value==""){ 
       $(title).animate({ 
        top: '-18px'}, '300'); 
       $('text').focus(); 
       } 

       { 
    $('.inputborder').css({ 
    border: 'solid 2px #49acc7'}, '300'); 
       } 

       { 
    $('.inputtitle').css({ 
    color: '#49acc7'}, '300'); 
       } 

} }

 function movedown(t){ 
      if (t.value==""){ 
       $('.inputtitle').animate({ 
       top: '0px'}, '300'); 
          } 

          { 
       $('.inputborder').css({ 
       border: 'solid 2px #bec3c8'}, '300'); 
          } 

          { 
       $('.inputtitle').css({ 
       color: '#bec3c8'}, '300'); 
          } 

     } 

인라인 코드

<div id="custnumbertitle" class="inputtitle" style="z-index:2;position:absolute;width:300px;height:35px;text-align:left;left:23px;top:0px;vertical-align:middle;line-height:35px;" onclick="moveup('custnumbertitle,custnumber')"><span style="background-color:white;"> CUSTOMER NUMBER </span> </div>

<Input Type="text" id="custnumber" onblur="movedown(this)" width="150px" style="z-index:1;position:relative;top:3px;right:0px;width:320px;height:30px;border-radius:20px;border: solid 0px #bec3c8;"><a href="#" class="tooltip">

답변

0

좋은 양의 청소를 사용할 수있는 것처럼 보이는 코드가 있습니다. 먼저 (text).value=="")((text).value=="")이어야합니다. 거기에는 아무런 이유도없는 것으로 보이는 대괄호가 많이 있습니다. 상자가 튀어 나와 텍스트 입력을 덮고 싶다고 말하면 this here과 같은 의미입니까?

+0

대단히 그렇게 생각합니다. 완벽하게 작동해야합니다. ^ – JotaroUchiha

관련 문제