输入在.slideToggle()之后丢失占位符和一些样式

时间:2012-05-27 03:30:22

标签: jquery html5

当我调用jQuery 1.7.2的.slideToggle()方法时,输入元素会丢失其占位符并且其位置被破坏。它已经走到了屏幕的顶端。

CSS:

$("#go").click(function(){
    $("#second").slideToggle("slow");
});

HTML:

<input type="text" id="first" placeholder="first" />
<input type="text" id="second" placeholder="second" style="display: none;" />
<button id="go">Go</button>

当我尝试在Google Chrome中检查此元素时,占位符会返回并且样式会正常化。

为什么会这样?

0 个答案:

没有答案