Results 1 to 5 of 5
Threaded View
-
9th Nov 2011, 02:17 AM #4Member
Just read in shout box that you have css
copy this part into your css section of HTML
#txt {
border:none;
font-family:Arial; <=== you can change font style
font-size:20pt; <== change the font size watever size u want
font-weight:bold; <== bold italic watevre u choose
border-right-color:#FFFFFF <== color code
}
set 2..copy and paste this in your javascipt
var mins
var secs;
function cd() {
mins = 1 * m("10"); // <= u can change minutes here
secs = 0 + s(":01"); // <= u can change seconds here (always add an additional second to your total)
redo();
}
function m(obj) {
for(var i = 0; i < obj.length; i++) {
if(obj.substring(i, i + 1) == ":")
break;
}
return(obj.substring(0, i));
}
function s(obj) {
for(var i = 0; i < obj.length; i++) {
if(obj.substring(i, i + 1) == ":")
break;
}
return(obj.substring(i + 1, obj.length));
}
function dis(mins,secs) {
var disp;
if(mins <= 9) {
disp = " 0";
} else {
disp = " ";
}
disp += mins + ":";
if(secs <= 9) {
disp += "0" + secs;
} else {
disp += secs;
}
return(disp);
}
function redo() {
secs--;
if(secs == -1) {
secs = 59;
mins--;
}
document.cd.disp.value = dis(mins,secs); //<== if you want to setup additional displays here.
if((mins == 0) && (secs == 0)) {
window.alert("Time is up. Press OK to continue."); // <== you can put ur timeout message as want but in the ()
// window.location = "yourpage.htm" //<== this redirects to specified page once timer ends and ok button is hit
} else {
cd = setTimeout("redo()",1000);
}
}
function init() {
cd();
}
window.onload = init;
Now...Copy this code in the head of your html page
<script type="text/javascript" src="countDown.js"></script>
</head>
copy this code into ur html body section
<form name="cd">
<input id="txt" readonly="true" type="text" value="10:00" border="0" name="disp">
</form>
This will alert user with pop up once timer end and if you give redirect path..it will take the user to your given link once they hit Ok button in pop up alert...you can omit that [part if you dunt need.
Hope this help..Let me know if any error occurs
P.S : The text after //<== .... is just for instruction ..if you can delete them when you paste in notepad
for ex : window.alert("Time is up. Press OK to continue."); // <== you can put ur timeout message as want but in the ()
Delete from this line : // <== you can put ur timeout message as want but in the ()
Make sure you upload your countdown.js file on ur host.
excuse me : I am not English native.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Countdown comments
By r00ts in forum WordpressReplies: 0Last Post: 29th Sep 2012, 10:47 AM -
Java stinks: Turn off your Java browser plugin
By Loget in forum General DiscussionReplies: 37Last Post: 5th Sep 2012, 07:40 AM -
Need Help HTML/Java Script Twitter/Countdown fixing
By Andy~s in forum Web Development AreaReplies: 0Last Post: 19th Dec 2010, 06:29 PM -
The Google Countdown
By Angeix in forum General DiscussionReplies: 9Last Post: 14th Dec 2009, 11:37 AM -
openSUSE 11.2 countdown (:
By Hyperz in forum General DiscussionReplies: 30Last Post: 19th Nov 2009, 12:08 AM
themaCreator - create posts from...
Version 3.52 released. Open older version (or...