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, 08:25 AM
The Creator The Creator is offline
Contributing User
Tutorialized Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: England
Posts: 1,287 The Creator New User: is a brand new recruit and a unknown entity at this point. 
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, 10: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 28 m 4 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, 11:17 AM
The Creator The Creator is offline
Contributing User
Tutorialized Beginner (1000 - 1499 posts)
 
Join Date: Jan 2006
Location: England
Posts: 1,287 The Creator New User: is a brand new recruit and a unknown entity at this point. 
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, 11: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 28 m 4 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...


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT