Hi this should be a really easy problem but i am stuck. Is it possible to fade out the text inside a text box and textarea and leave the actual element in place. I have tried fading out using .html() .val() etc but the element that the text is in is always faded too.
+4
A:
I think the only way to achieve this is by manipulating the input element's colour. Check out the JQuery color plugin that specializes in colour manipulations.
It should work along the lines of
$(formelement).animate({ color: "#FFFFFF" }, 600);
Pekka
2010-02-19 14:47:06
hey thanks for the suggestion. i tried to change it to white and then just remove the val() but it didnt really fade to the white color
David
2010-02-19 15:43:37
Can you post an on-line example to check out?
Pekka
2010-02-19 15:44:07
A:
Simply surround the text in a span and fade the span. JQuery will fade the element, this is the easiest way. I am not sure there is a way to fade just text and not the entire DOM element.
Edit: Didn't read the textarea part. To do this you'll probably want to hide the actual input element and style a new one to look like a text element, and then fade the text inside it. This is commonly done to restyle the look of an input element.
Jeremy B.
2010-02-19 14:48:03