Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Help Appreciated


ghost's Avatar
0 0

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 != &quot;undefined&quot;);	


StartTimer();

//expand the header size
top.document.body.rows = &quot;100,*,0&quot;;

function getRef(obj){
	if(getById)
		return(typeof obj == &quot;string&quot;) ? document.getElementById(obj) : obj;
}

function StartTimer(){
	setTimeout(&quot;UpdateTimer()&quot;,300);
}

function UpdateTimer(){
	FormatMinutes();
	FormatSeconds();
	if(getRef(&quot;clock&quot;) != null){
		getRef(&quot;clock&quot;).innerHTML = &quot;&quot; + Minutes + &quot;:&quot; + Seconds;
		if(ElapsedSeconds &gt; 0){
			//document.bgColor=&quot;#F0F54C&quot;;
			setTimeout(&quot;UpdateTimer()&quot;,1000);
		}
		else{
			//CommunicateFrame(&quot;CourseNavigation&quot;,&quot;SecurityQuestion.aspx?TimerExpired=true&quot;);
			parent.location = &#39;LoggedOut.aspx?logout=1&sec=2&#39;;
		}
		ElapsedSeconds = ElapsedSeconds - 1;
	}
	else{
		//document.bgColor=&quot;red&quot;;
	}
	
}

function FormatMinutes(){
	Minutes = Math.floor(ElapsedSeconds/60 % 60);
	if(Minutes &lt;= 9) {
		Minutes = &quot;0&quot;+Minutes;
	}
}

function FormatSeconds(){
	Seconds = Math.floor(ElapsedSeconds % 60);
	if(Seconds &lt;= 9) {
		Seconds = &quot;0&quot;+Seconds;
	}
}

function CommunicateFrame(FrameName, Location){
	href = Location;
	if(href.indexOf(&quot;?&quot;) == -1){
		href += &quot;?random=&quot; + Math.random();
	}
	else{
		href += &quot;&random=&quot; + Math.random();
	}
	parent.frames[FrameName].document.location.href = href;
	return true;
}

// --&gt;[code]

ive tried different approaches, but have come up with nothing. thanks in advance.


ghost's Avatar
0 0

What about:

javascript:void(ElapsedSeconds=0)

I'm not entirely sure what you're asking, but that would zero the countdown.


ghost's Avatar
0 0

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.


ghost's Avatar
0 0

It worked on mine. Can you pm me the actual site/page?