Visual C

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDesktop ProgrammingVisual C

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old May 13th, 2007, 07:25 AM
The Creator The Creator is offline
Contributing User
Tutorialized Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: England
Posts: 1,286 The Creator User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 35 sec
Reputation Power: 0
Send a message via MSN to The Creator
Displaying text and then removing it...

I wanna display some text for 5 seconds and then remove it, this is the code i got so far...


document.getElementById('option' + id).innerHTML += 'You have already voted';


this displays the text in the right place, but i want it to only last for 3 or 4 seconds and then remove itself...

anyone got any ideas?

Reply With Quote
  #2  
Old May 13th, 2007, 09:38 AM
Chippo Chippo is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Stockport, UK
Posts: 462 Chippo New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 23 h 32 m 47 sec
Reputation Power: 0
Send a message via MSN to Chippo
you could do
function settext(thevalue,id){
document.getElementById('option'+id).innerHTML = thevalue;
}
window.setTimeout(settext('',1),3000);

or maybe even

window.setTimeout(function(){document.getElementBy Id('option'+id).innerHTML = thevalue;},3000);

Im not sure if the second one will work, but I cant see why not.

hope that helps or is understandable

Reply With Quote
  #3  
Old May 13th, 2007, 10:17 AM
The Creator The Creator is offline
Contributing User
Tutorialized Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: England
Posts: 1,286 The Creator User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 35 sec
Reputation Power: 0
Send a message via MSN to The Creator
well the second one worked, once i removed the 'window' bit from the front...

but that waited 3 seconds and then displayed the text...

i wanted to immediately display the text and then remove it after 3 seconds...

Reply With Quote
  #4  
Old May 13th, 2007, 10:54 AM
Chippo Chippo is offline
Contributing User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Stockport, UK
Posts: 462 Chippo New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 23 h 32 m 47 sec
Reputation Power: 0
Send a message via MSN to Chippo
ok try
Code:
function settext(id){
  document.getElementById('option'+id).innerHTML = 'You have already voted';
  setTimeout(function(){document.getElementBy Id('option'+id).innerHTML = '';},3000);
}

then you just call that function to set the text for that given box.
e.g
settext(boxidhere);

Reply With Quote
Reply

Viewing: Tutorialized ForumsDesktop ProgrammingVisual C > Displaying text and then removing it...


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap