开发者

Fading the text of a text input box

开发者 https://www.devze.com 2023-04-02 09:56 出处:网络
I hav开发者_开发百科e an input box $myInput = $(\'<input/>\').val(\'Some text\'). I would like to fade away the text of the input box, but not the input box itself. Can I use jQuery for that?$m

I hav开发者_开发百科e an input box $myInput = $('<input/>').val('Some text').

I would like to fade away the text of the input box, but not the input box itself. Can I use jQuery for that?


$myInput.animate({'color':'white'});

to fade it out. To fade it back

$myInput.animate({'color':'black'});

I assume you have white background on input


You can use the color animation plugin to color the text to the input's background color (most probably white).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号