-
Nov 12th, 2011, 05:03 PM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Problem using a timer to change div styles
I've created a page to show a 'please wait' box then using a timer to hide the 'please wait' box and show other div elements.
Code:
function StartTheTimer(){
if (secs==0)
{
StopTheClock()
// when finished show quote and continue
document.getElementById("form-pagebreak-back_14").style="display:block;"
document.getElementById("form-pagebreak-next_14").style="display:block;"
document.getElementById("id_15").style="display:block;"
document.getElementById("id_168").style="display:block;"
document.getElementById("id_178").style="display:block;"
document.getElementById("id_18").style="display:block;"
document.getElementById("id_4").style="display:block;"
document.getElementById("cid_4").style="display:block;"
}
else
{
self.status = secs
secs = secs - 1
timerRunning = true
timerID = self.setTimeout("StartTheTimer()", delay)
}
I use the Free Javascript Editor and when i run the code it stops at this line and says 'not implemented'.
Code:
document.getElementById("form-pagebreak-back_14").style="display:block;"
Thanks in advance, Chris1990.
If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.
If you fail, try and try again, its the only way to success.
-
Nov 13th, 2011, 02:41 AM
#2
Re: Problem using a timer to change div styles
Try this,
HTML Code:
document.getElementById("form-pagebreak-back_14").style.property="display:block;"
-
Nov 13th, 2011, 03:27 AM
#3
Re: Problem using a timer to change div styles
When setting styles via DOM you want to use element.style.property = "foo", not element.style = "property:foo". It's slightly different to how you define it in a CSS file.
JavaScript Code:
document.getElementById("form-pagebreak-back_14").style.display = "block";
https://developer.mozilla.org/en/DOM...ng_information
-
Nov 13th, 2011, 09:38 AM
#4
Thread Starter
Hyperactive Member
Re: Problem using a timer to change div styles
thanks for your help its working now.
If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.
If you fail, try and try again, its the only way to success.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|