2

When I call the .slideToggle() method of jQuery 1.7.2, the input element lose its placeholder and its position is broken. It's gone to the top of the screen.

The CSS:

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

The HTML:

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

When I try to inspect this element in Google Chrome the placeholder goes back and styles are normalized.

Why does this happen?

random
  • 9,774
  • 10
  • 66
  • 83
Dmitry Belaventsev
  • 6,347
  • 12
  • 52
  • 75
  • It works fine in Safari 5.1.7 on Lion, which version of chrome/OS are you using? Can you post a screenshot? – K Z May 27 '12 at 03:41
  • chrome 19 / win7 64bit but on ff 11 / win7 64 bit it works fine – Dmitry Belaventsev May 27 '12 at 03:46
  • maybe I should use smth. like this https://github.com/eymengunay/jquery-placeholder to fix the problem for now. But it still interesting for me - what fires this bug. – Dmitry Belaventsev May 27 '12 at 03:53
  • 2
    Interesting, it appears in Chrome for me as well. Sorry I couldn't find a solution. It seems like it might be related to the jumpiness bug of `slideToggle()` though: http://stackoverflow.com/questions/1335461/jquery-slide-is-jumpy My suggestion would be to use other jQuery method instead to achieve the same effect. – K Z May 27 '12 at 04:02

0 Answers0