Jump to content

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

how to show()/remove() a textarea with jquery

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
5 replies to this topic

#1 Brainx7   Members   

144
Like
0Likes
Like

Posted 30 June 2014 - 10:32 AM

I found this code http://jsfiddle.net/uhv5R/5/ which shows and hides with a selection but I want to remove it instead of hiding it when select is no. I used the function remove() for this but when I choose yes again it wont show it again, is like once you choose remove thats it its gone. Ho could I do this



#2 fastcall22   Moderators   

10680
Like
0Likes
Like

Posted 30 June 2014 - 11:11 AM

Detach is what you're looking for.

You should be using show/hide because DOM operations can be expensive.
zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

#3 DiegoSLTS   Members   

2113
Like
0Likes
Like

Posted 30 June 2014 - 11:25 AM

So, you want to "remove instead of hiding", but then you want to show it again? If you want to show it again then hiding it makes much more sense.


Edited by DiegoSLTS, 30 June 2014 - 11:26 AM.


#4 Brainx7   Members   

144
Like
0Likes
Like

Posted 30 June 2014 - 12:46 PM

I solved it http://jsfiddle.net/dnwTV/126/



#5 fastcall22   Moderators   

10680
Like
2Likes
Like

Posted 30 June 2014 - 12:56 PM

$('.Option > textarea:last').last().remove();

.
.
.

$('<textarea ></textarea>').fadeIn('fast').appendTo('.Option');


I, um... wat.

ಠ__ಠ

Edited by fastcall22, 30 June 2014 - 12:56 PM.

zlib: eJzVVLsSAiEQ6/1qCwoK i7PxA/2S2zMOZljYB1TO ZG7OhUtiduH9egZQCJH9 KcJyo4Wq9t0/RXkKmjx+ cgU4FIMWHhKCU+o/Nx2R LEPgQWLtnfcErbiEl0u4 0UrMghhZewgYcptoEF42 YMj+Z1kg+bVvqxhyo17h nUf+h4b2W4bR4XO01TJ7 qFNzA7jjbxyL71Avh6Tv odnFk4hnxxAf4w6496Kd OgH7/RxC

#6 Brainx7   Members   

144
Like
0Likes
Like

Posted 30 June 2014 - 03:02 PM

 

$('.Option > textarea:last').last().remove();

.
.
.

$('<textarea ></textarea>').fadeIn('fast').appendTo('.Option');

I, um... wat.

ಠ__ಠ

 

lol the original fiddle was different I made a couple of changes, if that's what you are implying






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.