Seems like jQuery removes the value of a input fields that has been slided up and then afterwards down. Not quite sure if it\'s the placeholder who does it but the built in slid
It seems like a bug in chrome (not jQuery). It works fine in ff.
Its something related with font-size
, I guess. Chrome does not loses font-size
but if you set again, it works.
$(document).ready(function () {
$('#slideUp').click(function () {
$('input[type="text"]').slideUp(1000);
});
$('#slideDown').click(function () {
$('input[type="text"]').slideDown(1000,function(){
$(this).css('font-size',$(this).css('font-size'));
});
});
});
Demo
EDIT:
I see that above hack works for one time only. If you slide up/down again, it fails.
Here's a better hack.
.text{
font-size:13px;
}
$(document).ready(function () {
$('#slideUp').click(function () {
$('input[type="text"]').slideUp(1000,function(){
$(this).removeClass('text');
});
});
$('#slideDown').click(function () {
$('input[type="text"]').slideDown(1000,function(){
$(this).addClass('text');
});
});
});
Demo