Very practical script that allows you to display a "What's New" image beside new content for a certain amount of time, then disappear automatically when the time expires. Just set a date, and the image will be displayed up to and until that date, then automatically be removed.
We have tested the code in IE 7.0, Firefox 2.0.0.3, Opera 9.20, Netscape 8.1.2 and AOL Explorer 1.5. This script worked well in all platforms with no variations observed.
Depending on your knowledge of HTML and javascripts, this is an easy two (2) part copy and paste code that goes in both the <HEAD> section (This part is where you add your uploaded "New Image" graphic to be displayed. See below:) and <BODY> section (as many places as you need to have this effect be visible )of your document.
//set the below to the image you wish to use as the "new" image
var imagetag='<img src="Full Path To Uploaded Image"border="0" width="?" height="?" alt="?" align="middle">'
var today=new Date()
function expireat(expiredate){
I n the above section of code where you insert the full path to your uploaded image, you will notice the attribute of align="middle". This positions the graphic in relation to the text. It can be one of three different positions. This you can play around with until you like the position.
T he last part gets pasted alongside the "New" content. By doing so, a "What's New" image (the one you uploaded and put the path in the <BODY> section) will show up until the specified date in function "expireat()":
Here's an example:
<script>
expireat("Date To Expire Here*")
</script>
<a href="URL Address Here">New Material</a>
* The date must be written in a certain format for it to function.
<script>
expireat("December 23, 2005")
</script>
<a href="URL Address Here">New Material</a>
The <BODY> section part of the script is pasted in as many places you want the "New Material" image to appear. The <HEAD> section of the script is pasted only once.
We 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 ]
[ Some Animated Images ]
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 ] [ Form Index ] [ 2001 ] [ 2002 ] [ 2003 ] [ 2004 ] [ 2005 ] [ 2006 ] [ 2007 ] [ Disclaimer ] [ 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-