Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

javascript countdown


  • This topic is locked This topic is locked

#1
Ryan

Ryan

    Member 4k

  • Member
  • PipPipPipPipPipPipPip
  • 4,867 posts
OK, so I have the script, and it works. The only problem is that there is a border around the numbers. I want to get rid of that border,but I can't seem to find a way. Is it possible? Here is the code.

in <head>
<script type="text/javascript">

//change your event date event here.
var eventdate = new Date("May 11, 2006 18:00:00 GMT");

 function toSt(n)
 {s=""
  if(n<10) s+="0"
  return s+n.toString();
 }
 
 function countdown()
 {cl=document.clock;
  d=new Date();
  count=Math.floor((eventdate.getTime()-d.getTime())/1000);
  if(count<=0)
	{cl.days.value ="--";
	 cl.hours.value="--";
	 cl.mins.value="--";
	 cl.secs.value="--";
	 return;
	}
  cl.secs.value=toSt(count%60);
  count=Math.floor(count/60);
  cl.mins.value=toSt(count%60);
  count=Math.floor(count/60);
  cl.hours.value=toSt(count%24);
  count=Math.floor(count/24);
  cl.days.value=count;	
  
  setTimeout("countdown()",500);
 }

</script>

and in <body>
<form name="clock" action="none">

<input name="days" size="1" /> Days, <input name="hours" size="1" /> Hours, <input name="mins" size="1" /> Minutes, and <input name="secs" size="1" /> seconds.

</form>

Thanks in advance for any help.

-Ryan

Edited by rmurphy, 22 April 2006 - 12:12 AM.

  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Kinda late on this one, but I believe that as long as you use the <input> tags, you'll get that "little border" around the input box.

Ron
  • 0

#3
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
The thread is a year old. Don't you think it is a bit silly replying to it Major Payne?

You can add style="border:0" to remove the border from the input.
  • 0

#4
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Actually, no! I was clearing out all my pending ones that were put off answering because I was offline close to a year because of Katrina. And, no, you can not use border="0" because they are using <input> tags and what you see are not borders. Now I may be silly answering this after a year, but why are you here posting?

Ron
  • 0

#5
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
I am posting to correct what you say. And I never said border="0". I said style="border:0"

And they are borders. If you don't believe me try <input style="border:0" value="text with no border">
  • 0

#6
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
:whistling: I disagree ole Master, but end of posting. :blink:

Ron
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP