0
我想扩大输入字段。所以这几乎可行,但效果是“闪亮”。该领域扩大和colapses和intersseting使第二个输入到下一行。你可以给任何建议如何做它写或以某种方式重写!?!?!用动画放大输入元素
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>
Jsfiddle链接到TC:http://jsfiddle.net/fpgAn/ – 2010-12-08 16:08:56
我不明白这部分的含义是什么意思“内部关系使第二个输入到下一行”可以你澄清? – 2010-12-08 16:27:51