November 11th, 2002, 09:10 PM
|
#1 (permalink)
| | Senior Member
Join Date: Oct 2001 Location: Eastern Shore
Posts: 701
|
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 |
| |
November 11th, 2002, 09:15 PM
|
#2 (permalink)
| | Ultimate Member
Join Date: Nov 2001 Location: Winston-Salem, NC
Posts: 1,440
|
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
|
| |
November 11th, 2002, 09:16 PM
|
#3 (permalink)
| | Ultimate Member
Join Date: Jun 2002 Location: Iowa
Posts: 2,879
|
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 |
| |
November 11th, 2002, 09:19 PM
|
#4 (permalink)
| | dword to your moms
Join Date: Oct 2001 Location: ~/
Posts: 3,195
|
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. |
| |
November 11th, 2002, 10:09 PM
|
#5 (permalink)
| | Senior Member
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.
|
| |
November 11th, 2002, 11:13 PM
|
#6 (permalink)
| | Ultimate Member
Join Date: Jun 2002 Location: Iowa
Posts: 2,879
| |
| |
November 12th, 2002, 08:10 PM
|
#7 (permalink)
| | Senior Member
Join Date: Oct 2001 Location: Eastern Shore
Posts: 701
|
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 |
| |
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 |
| |
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!  |
| |
November 12th, 2002, 11:01 PM
|
#10 (permalink)
| | Senior Member
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.
|
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |