home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2886
Discussions: 188,379, Posts: 2,243,461, Members: 232,607
Old November 11th, 2002, 09:10 PM   Digg it!   #1 (permalink)
ILC
Senior Member
 
ILC's Avatar
 
Join Date: Oct 2001
Location: Eastern Shore
Posts: 701
HTML Help

Need a little help combining two segments of HTML. What I am basically trying to do is put a freeware data/time into a "bar" at the top of the page.

Here is the source for the bar
Code:
<td><img name="Datebar_r1_c1" src="Images/Datebar_r1_c1.gif" width="520" height="30" border="0" alt="">
and here is the source for the clock
Code:
<script language="javascript" src="liveclock.js">

/*
Live Clock Script-
By Mark Plachetta (astro@bigpond.net.auŠ) based on code from DynamicDrive.com
For full source code, 100's more DHTML scripts, and Terms Of Use,
visit http://www.dynamicdrive.com
*/

</script>
Thanks guys.

ILC

ILC is offline   Reply With Quote
Old November 11th, 2002, 09:15 PM     #2 (permalink)
Ultimate Member
 
cracked's Avatar
 
Join Date: Nov 2001
Location: Winston-Salem, NC
Posts: 1,440
Send a message via AIM to cracked
cant you just put one right after the other and it will work? sorry, only thing i can think of.

ps - ILC, until i posted this post, me and you had the exact same amount of posts! both 550.

drew
__________________
Visit http://duroo.org

cracked is offline   Reply With Quote
Old November 11th, 2002, 09:16 PM     #3 (permalink)
Ultimate Member
 
crouse's Avatar
 
Join Date: Jun 2002
Location: Iowa
Posts: 2,879
Send a message via ICQ to crouse
Actually you need the
liveclock.js file also.

If you don't have it..... you need to get it and upload it to the same directory your html file is in .......... in order for this to work.

HTH's
__________________
USA Linux Users Group
OpenSUSE.us

crouse is offline   Reply With Quote
Old November 11th, 2002, 09:19 PM     #4 (permalink)
dword to your moms
 
krohnjw's Avatar
 
Join Date: Oct 2001
Location: ~/
Posts: 3,195
Send a message via AIM to krohnjw
That isnt the clock source, that is merely what you put in the code to call the script...you will also need that image in the Images directory, I assume you've done that, and the .js file in your working HTML directory that index is in.
krohnjw is offline   Reply With Quote
Old November 11th, 2002, 10:09 PM     #5 (permalink)
ILC
Senior Member
 
ILC's Avatar
 
Join Date: Oct 2001
Location: Eastern Shore
Posts: 701
Yes, I have the actual source code (liveclock.js). When I just placed the two after each other it "stacked" them on top of each other. I want the clock to actually be displayed in the header bar.

P.S. Using Dreamweaver and Fireworks MX if that makes any difference.

ILC

P.S. Krohnj - Which image do I need in the images folder? Some image for the clock or the image for the header bar?

Last edited by ILC : November 11th, 2002 at 10:12 PM.
ILC is offline   Reply With Quote
Old November 11th, 2002, 11:13 PM     #6 (permalink)
Ultimate Member
 
crouse's Avatar
 
Join Date: Jun 2002
Location: Iowa
Posts: 2,879
Send a message via ICQ to crouse
crouse is offline   Reply With Quote
Old November 12th, 2002, 08:10 PM     #7 (permalink)
ILC
Senior Member
 
ILC's Avatar
 
Join Date: Oct 2001
Location: Eastern Shore
Posts: 701
More specific

Alright, looked through the actual code and I am pretty sure I found where all of the displaying is accomplished. Here is the code:
Code:
myclock = '';
		myclock += '<font style="color:'+myfont_color+'; font-family:'+myfont_face+'; font-size:'+myfont_size+'pt;">';
		myclock += mypre_text;
		myclock += hours+':'+minutes;
		if ((myupdate < 2) || (myupdate == 0)) { myclock += ':'+seconds; }
		myclock += ' '+dn;
		if (DisplayDate) { myclock += ' on '+DaysOfWeek[day]+', '+mday+mn+' '+MonthsOfYear[month]; }
		myclock += '</font>';
Now, how would I infuse that so it would be displayed in an image named Datebar_r1_c1 ?

Once again, thanks guys.

ILC
ILC is offline   Reply With Quote
Old November 12th, 2002, 09:50 PM     #8 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 563
well, if I understand correctly (which doesn't always happen) here's what I'd do

change the image to be a background-image in the td:

Code:
<td background="Images/Datebar_r1_c1.gif" width="520" height="30" border="0" alt=""></td>
then, I'd throw the 'startup' code for the clock into that cell, giving me this:

Code:
<td background="Images/Datebar_r1_c1.gif" width="520" height="30" border="0" alt="">
    <script>
    <!-- hide from dumb browsers! :p
    new LiveClock('verdana','3','#000000','#ffffff','<b>Your Time:','</b>','200','0','1','0','0','null');
    //-->
    </script>
</td>
uummm... I think that would accomplish what you want!! Mind you, I never tested it!!! ...and I haven't seen the page that it's being put into, so the background-image might not work for you...

cheers!

also, more info on the clock here
^hyd^ is offline   Reply With Quote
Old November 12th, 2002, 10:07 PM     #9 (permalink)
Senior Member
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 563
well... just did a quik test and it appears to work fine... with the exception of how the author creates a background color for the clock, which looks lame with a bg image... so, to get rid of that, you'd want to replace function LC_CreateClock(c) with this one:
Code:
function LC_CreateClock(c) {
	if(LC_IE||LC_N6){clockTags='<span id="'+c.Name+'" style="width:'+c.Width+'px;"></span>'}
	else if(LC_NS){clockTags='<ilayer width="'+c.Width+'" id="'+c.Name+'Pos"><layer id="'+c.Name+'"></layer></ilayer>'}

	if(!LC_Old){document.write(clockTags)}
	else{LC_UpdateClock(LC_Clocks.length-1)}
}
(took out the background color sections)
and change the function call to like this one:
Code:
new LiveClock('verdana','3','#000000','','<b>Your Time:','</b>','200','0','1','0','0','null');
(no background color specified...)

and cross your fingers!

things I noticed....
- Netscape 4.78 I had to hit 'reload' to get it to work the first time...
- Opera 6.03 the clock didn't run ...it'd only change time whenever I refreshed the page.
- IE5.5, worked fine as afaict.

cheers!
^hyd^ is offline   Reply With Quote
Old November 12th, 2002, 11:01 PM     #10 (permalink)
ILC
Senior Member
 
ILC's Avatar
 
Join Date: Oct 2001
Location: Eastern Shore
Posts: 701
Thanks hyd, there is enough there for me to play around with it. I really appreciate it!

ILC

Last edited by ILC : November 12th, 2002 at 11:04 PM.
ILC is offline   Reply With Quote
Reply


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

Posting Rules
You may post new threads
You may 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 On
Refbacks are Off

Most Active Discussions
Is It Just Me? (2885)
The United States Debt (20)
Looks like Burris will get his Sena.. (8)
I think I just killed my computer w.. (24)
Upgrading RAM (5)
Folderchat Weekday thread (439)
Antec 300 bulk purchase? (11)
Worth the upgrade?? (14)
Help with an Ati Radeon HD 4850 512.. (25)
Recent Discussions
Best digital camera for under 2.. (14)
Help with an Ati Radeon HD 4850.. (25)
Install Problem for Windows Def.. (0)
New Build ( Finally ) (1)
dual monitors wont boot (0)
Folderchat Weekday thread (439)
MSN Hotmail Down??? (7)
Laptop waking up itself (0)
CPU wont boot (3)
Blackberry Storm, Gears of War .. (1)
Core 2 Quad Q9550 system (3)
COWBOOM Ripoff! Used Laptop w/$.. (4)


All times are GMT -4. The time now is 08:39 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28