2010-12-08 5 views
0

입력 필드를 확장하고 싶습니다. 그래서 이것은 거의 작동하지만 efect는 "blinky"입니다. 필드가 확장되고 collapses 및 intereseting 두 번째 입력을 다음 행으로 이동합니다. 어떤 방법 으로든 그것을 쓰거나 재 작성하는 방법에 대해 조언을 해줄 수 있습니까!애니메이션으로 입력 요소를 확대하십시오.

jQuery를

$('#menusearchform .s').mouseenter(function(){ 
     var $this = $(this); 
     if (!$this.data('expand')) { 
        $this.data('expand', true); 
        $this.animate({width:'+=32px',left:'-=16px'}); 
     } 
     $this.val("").focus(); 
}).mouseleave(function(){ 
     var $this = $(this); 
     $this.data('expand', false); 
     $this.animate({width:'-=32px',left:'+=16px'}); 
    }); 

HTML

<div id="divsearch"> 
    <form method="post" action="index.php" id="menusearchform"> 

      <input class="s" type="text" value="Search" name="felem1" /> 
      <input class="s" type="text" value="Search" name="felem2" /> 

      <input type="submit" value="Search" name="buttonSearch" /> 
      <input type="reset" value="Reset" name="buttonReset" id="Reset"/> 
    </form> 
</div> 
+1

TC : http://jsfiddle.net/fpgAn/ –

+0

이 부분이 "intereseting이 두 번째 입력을 다음 행으로 이동하게 만듭니다"는 것을 이해하지 못합니다. 너 분명해? –

+0

두 번째 입력 필드는 첫 번째 입력 필드 아래의 새 행으로 이동합니다. – Bakudan

답변

0

당신이 전체 양식을 확장하고 싶지 않은 추측. 아마도 이것은 당신이 필요로하는 것일 것입니다 : http://jsfiddle.net/fpgAn/1/

+0

실제로 내가 원했던 것 : – Bakudan

관련 문제