U se this code snippet to display "Today's Day and Date" on your web page.
We have tested the code in IE6.0, Firefox1.5.0.4, Opera9.0, Netscape8.1 and AOL Explorer1.2. This script worked well in all platforms with no variations observed.
D
epending on your knowledge of HTML and javascripts, this is an easy one (1) part copy and paste code that goes anywhere in the <BODY> section you want this effect to appear. The only possible reconfiguration that could be made are to change the font color, size and face.
This is done by placing a complete "<font tag>" (See Below) just before the script and then close it(</font>) at the end of the script.
<font face="georgia,arial,helvetica"size="4"color="#00FFFF">
<SCRIPT LANGUAGE="JavaScript">
Script Is Located Between The Above And Below Closing </script> Points
// Print out the data.
document.write("" +today+ ".");
// End -->
</script></font>
N otice where we placed the complete font tag and the closing </font> tag. You can change the style, color and size in the font tag to suit your site.
N otice in the below section of code the red dot (.). What this is when you view the day and date, a period after the year. If you do not want the period just remove it but be sure not to remove the quotation marks that encompass it. See below:
Default // Print out the data. |
Reconfigured ~ No Period // Print out the data. |
Reconfigured With Different Character // Print out the data. |
N otice where we placed the little characters ~. This will show up on the effect before and after the displaying day and date. So it is your choice is you want accent(s) around the effect or not.
T o achieve the effect of blending the day date directly into a sentence is quite simple. Just place the beginning of the script one space after the word you want it to follow and thats it. See below:
T his is a start of a sentence where we want you to know that today is <SCRIPT LANGUAGE="JavaScript"> script goes here</script>.B y placing the script as above, the day and date would blend in seamlessly into the sentence as in the below example.
T his is a start of a sentence where we want you to know that today is . See how the day and date blend perfectly into the sentence without any hint it is a script. The only way you can tell is because we added a font tag with the color #00FFFF.
We shall cover and to answer your question in a word, it is "Yes", you can add images* around the day/date if you want. They do need to be "Inserted A Certain Way" or the script itself will stop functioning and not seen. Grab the below link to see a working example of images on either side of the day/date. See below on where and howto.
[ Example With Images Surrounding The Day/Date ]
* Remember we discussed the removal of the . earlier and adding the characters around the day/date. (We had these example set inside three tables) Well, these are the locations you can add little images around it.
<!---------- Below Is The Image Tag ---------->
<img src='path to image here' border='0' width='?' height='?' alt='?' '>
<!---------- Above Is The Image Tag ---------->
// Print out the data.
document.write("Above Image Tag Here" +today+ "Above Image Tag Here");
// End -->
</script>
N otice in the above image tag we made exclusive use of the apostrophe ' within the image tag itself. Reason being is quite simple. The script itself is designed with both apostrophes (') and quotation marks ("). Where you are inserting the image tag is surrounded by quotation marks. If you add more than the script calls for inside the quotation marks, it will not understand and stop functioning. So............... a work around is to add apostrophes (') to offset it and still have the script work.
j ust replace the ? with the attributes for the image used. The border='0' attribute actually only comes into play when the image is associated to a URL (link). But is is always a good idea to define the border either way. The alt='?' is just text that describes the image or if associated with a link can give a little description of the link. Just place your cursor on the above little smiley and see the alt tag text appear.
W
e hope our tutorial was easy to follow and we covered everything in detail. If you would like to add this effect into your pages, grab the respective below link and you are there. If you have any problems with this or anything else, feel free to consult our [ FAQ ] and if you can't find the answer there, [ contact us ].
[ Get Code Here ]
[ Rate This Page ]
Search Our Site By Individual letter
[ A ]
[ B ]
[ C ]
[ D ]
[ E ]
[ F ]
[ G ]
[ H ]
[ I ]
[ J-K ]
[ L ] |
Little Tips Directory [ Page 1 ] [ Page 2 ] [ Page 3 ] [ Page 4 ] [ Page 5 ] [ Page 6 ] [ Page 7 ] |
[ Index Page 1 ]
[ Index Page 2 ]
[ Index Page 3 ]
[ Index Page 4 ]
[ Index Page 5 ] [ Index Page 6 ] [ Index Page 7 ] [ Index Page 8 ] [ Index Page 9 ] [ Index Page 10 ] [ Index Page 11 ] [ Index Page 12 ] [ Index Page 13 ] [ News Letter Archives ]
[ Navigation Page ]
[ Archives Of Published Material ] |
If you are part of the ever growing number of webmasters who enjoy
sharing your knowledge with others on web design, join The
Consigliere Ltd. web ring to broaden your scope of exposure.
Join Today
This Site Was Built And Is Maintained Exclusively by
The Webmaster @ Consigliere Ltd.
Copyright © Consigliere Ltd., All Rights Reserved. 2001-