IT Community - Software Programming, Web Development and Technical Support

Stop watch that can be paused and unpaused.

This is a discussion on Stop watch that can be paused and unpaused. within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; Hi all... Can anyone tell me how can i stop watch that can be paused and unpaused. Thanks in advance......


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > HTML, CSS and Javascript Coding Techniques

Register FAQ Members List Calendar Mark Forums Read
  #1  
Old 03-01-2008, 02:20 AM
itbarota itbarota is offline
D-Web Architect
 
Join Date: Jun 2007
Posts: 542
itbarota is on a distinguished road
Default Stop watch that can be paused and unpaused.

Hi all...


Can anyone tell me how can i stop watch that can be paused and unpaused.



Thanks in advance...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 08-20-2008, 08:37 PM
Miakoda Miakoda is offline
D-Web Trainee
 
Join Date: Jul 2008
Posts: 36
Miakoda is on a distinguished road
Default Re: Stop watch that can be paused and unpaused.

HI

take a look

<!-- THREE STEPS TO INSTALL STOPWATCH:

1. Paste the coding into the HEAD of your HTML document
2. Copy the onLoad event handler into the BODY tag
3. Add the last code into the BODY of your HTML document -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">


<!-- Begin
var ms = 0;
var state = 0;
function startstop() {
if (state == 0) {
state = 1;
then = new Date();
then.setTime(then.getTime() - ms);
} else {
state = 0;
now = new Date();
ms = now.getTime() - then.getTime();
document.stpw.time.value = ms;
}
}
function swreset() {
state = 0;
ms = 0;
document.stpw.time.value = ms;
}
function display() {
setTimeout("display();", 50);
if (state == 1) {now = new Date();
ms = now.getTime() - then.getTime();
document.stpw.time.value = ms;
}
}
// End -->
</SCRIPT>

<!-- STEP TWO: Add this onLoad event handler into the BODY tag -->

<BODY onLoad="display()">

<!-- STEP THREE: Put this code into the BODY of your HTML document -->

<CENTER>
<FORM NAME="stpw">
Time:
<INPUT TYPE="text" Name="time">
<INPUT TYPE="BUTTON" Name="ssbutton" VALUE="Start/Stop" onClick="startstop()">
<INPUT TYPE="BUTTON" NAME="reset" VALUE="Reset" onClick="swreset()">
</FORM>
</CENTER>


thanks
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 09-25-2008, 01:22 AM
limon limon is offline
D-Web Trainee
 
Join Date: Sep 2008
Posts: 3
limon is on a distinguished road
Default Html

Paste the coding into the HEAD of your HTML document.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 09-26-2008, 12:27 AM
sakari sakari is offline
D-Web Trainee
 
Join Date: Sep 2008
Posts: 27
sakari is on a distinguished road
Default Re: Html

thanks for the code Miacoda not you limon, where is your code.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop the Refreshing Kirubhananth HTML, CSS and Javascript Coding Techniques 2 03-19-2008 08:42 PM
How to watch a file using C#? S.Vinothkumar C# Programming 4 09-25-2007 11:30 PM
How to watch a file whenever we change or modify the content using c#? mobilegeek C# Programming 5 08-20-2007 06:38 AM
How do we stop the ajax request? raj PHP Programming 2 07-22-2007 09:39 PM
when to stop testing? vadivelanvaidyanathan Software Testing 0 04-11-2007 12:59 AM


All times are GMT -7. The time now is 06:03 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.
Our Partners
One Way Moving Companies | Stamford Dentist | Euro Millions Lottery | Home Loans| Furniture

SEO by vBSEO 3.0.0