Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > HTML / XHTML
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 12-06-2000, 08:53 AM
  #1
Chris
 
Posts: n/a
Question

I have gotten hold of HTML doce that displays the time and date on my Intranet pages, trouble is it is alligned left of the page and i would prefer it to be Central. Could anyone please help me !!!

Thanks in Advance
  Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 12-06-2000, 09:13 PM
  #2
Ian
Sheriff (Almighty)
 
Ian's Avatar
 
Join Date: Nov 1999
Location: Chch New Zealand God Mode: On
Posts: 3,167
iTrader: (0)
Ian is on a distinguished road
Post

hi Chris,
can you post your script and hopefully we can point out which parts need to be altered so you can align it to suit your site.
Thanks.

------------------
Ian

Web Development - BIG Resources Inc
Head Guide - 123Webmaster.com
ian@123webmaster.com
BIG Resources.com
ICQ: 25828668
Ian is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 12-07-2000, 03:50 AM
  #3
chris
Fighter (Level 4)
 
Join Date: Dec 2000
Location: N.Wales GB
Posts: 31
iTrader: (0)
chris is on a distinguished road
Talking

Hi Ian

Cheers for the reply - here is the code !!
---------------------------------------------

<script>

/*
Live Date Script-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/


var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","Novem ber","December")

function getthedate(){
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var dn="AM"
if (hours>=12)
dn="PM"
if (hours>12){
hours=hours-12
}
if (hours==0)
hours=12
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
//change font size here
var cdate="<small><font color='000000' face='Arial'><b>"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+" "+hours+":"+minutes+":"+seconds+" "+dn
+"</b></font></small>"
if (document.all)
document.all.clock.innerHTML=cdate
else
document.write(cdate)
}
if (!document.all)
getthedate()
function goforit(){
if (document.all)
setInterval("getthedate()",1000)
}

</script>
<span id="clock"></span>

---------------------------------------------


chris is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 12-07-2000, 04:22 AM
  #4
jehraen
Soldier (Level 11)
 
Join Date: Nov 2000
Posts: 147
iTrader: (0)
jehraen is on a distinguished road
Post

try putting <center> and </center> tags right before and after the <script> and </script> tags

Or another option would be to put the script in a centralised table.
jehraen is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 12-07-2000, 03:25 PM
  #5
Ian
Sheriff (Almighty)
 
Ian's Avatar
 
Join Date: Nov 1999
Location: Chch New Zealand God Mode: On
Posts: 3,167
iTrader: (0)
Ian is on a distinguished road
Post

Hi, you could also add a style tag to the <span> tag like this:

<span id="clock" style="position:absolute;left:200;top:250;">
</span>

however I'm not sure if this works in NS browsers.
Let us know how you get on.
good luck.

------------------
Ian

Web Development - BIG Resources Inc
Head Guide - 123Webmaster.com
ian@123webmaster.com
BIG Resources.com
ICQ: 25828668
Ian is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote

Reply
KEEP TABS
SPONSORS
 
Boxedart



 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 12:57 AM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.