Uh oh. Looks like your using an ad blocker.
Our site is support by ads that help to pay our hosting costs. Please disable or whitelist us within your ad blocker to help us keep the site online.
All money generate by ads and donations is used to pay the hosting costs of the site.
View Thread
Author | Help Appreciated | Member

Posts: Location:
Joined: 01.01.70 Rank: Guest | | i have a script that has been bothering me and i REALLY need to void it. the script is as follows:
[code] <!--
var ElapsedSeconds = 90;
var Seconds = 0;
var Minutes = 0;
var Hours = 0;
var clock;
var getById = (typeof document.getElementById != "undefined");
StartTimer();
//expand the header size
top.document.body.rows = "100,*,0";
function getRef(obj){
if(getById)
return(typeof obj == "string") ? document.getElementById(obj) : obj;
}
function StartTimer(){
setTimeout("UpdateTimer()",300);
}
function UpdateTimer(){
FormatMinutes();
FormatSeconds();
if(getRef("clock") != null){
getRef("clock").innerHTML = "" + Minutes + ":" + Seconds;
if(ElapsedSeconds > 0){
//document.bgColor="#F0F54C";
setTimeout("UpdateTimer()",1000);
}
else{
//CommunicateFrame("CourseNavigation","SecurityQuestion.aspx?TimerExpired=true");
parent.location = 'LoggedOut.aspx?logout=1&sec=2';
}
ElapsedSeconds = ElapsedSeconds - 1;
}
else{
//document.bgColor="red";
}
}
function FormatMinutes(){
Minutes = Math.floor(ElapsedSeconds/60 % 60);
if(Minutes <= 9) {
Minutes = "0"+Minutes;
}
}
function FormatSeconds(){
Seconds = Math.floor(ElapsedSeconds % 60);
if(Seconds <= 9) {
Seconds = "0"+Seconds;
}
}
function CommunicateFrame(FrameName, Location){
href = Location;
if(href.indexOf("?") == -1){
href += "?random=" + Math.random();
}
else{
href += "&random=" + Math.random();
}
parent.frames[FrameName].document.location.href = href;
return true;
}
// -->[code]
ive tried different approaches, but have come up with nothing. thanks in advance.
Edited by on 13-10-07 05:13 |
 |
Author | RE: Help Appreciated | Member

Posts: Location:
Joined: 01.01.70 Rank: Guest | | What about:
javascript:void(ElapsedSeconds=0)
I'm not entirely sure what you're asking, but that would zero the countdown.
|
 |
Author | RE: Help Appreciated | Member

Posts: Location:
Joined: 01.01.70 Rank: Guest | | i tried that already(didnt work), and you get the jist of wat im trying to do. im just trying to make the countdown timer go UP instead of DOWN, so i dont get logged out.
Edited by on 13-10-07 14:45 |
 |
Author | RE: Help Appreciated | Member

Posts: Location:
Joined: 01.01.70 Rank: Guest | | It worked on mine.
Can you pm me the actual site/page?
|
 |
|