我想扩展输入字段。所以这几乎可行,但效果是“眨眼”。该字段扩展和colapses和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>