The mm_timedNew() function allows the placement of a 'new' image to denote something new on a site.
To use the mm_timedNew() function:
-
Place the following code at the top of your menu_data.js file
function checkNew(date) { var appendToItem = ""; expdate = new Date(date); curdate = new Date(); if (expdate.getTime() > curdate.getTime()) { appendToItem = "image=thePath/new.gif;imagealign=left;imagealt=new item!;"; } return appendToItem; }
- change thePath to the path for your image and the new.gif to the name of your image
- You can add any of the 'image' modifying menu item properties in the last part of the assignment to appendToItem; e.g., imageheight, imagewidth, imageposition, etc.
- If you want to assign a different position to a top level image and a submenu image, you will need to copy the function, paste it at the top of the menu_data.js file and add a 1. If you want to do this, please read the note below.
- Add + checkNew('1/05/2006') as the last item in the aI string using your own date, of course. e.g.,
aI("text=Item Text;url=whatever.htm;" + checkNew('1/05/2004')); - If the expiration date has been reached, checkNew() does not return any information for the menu item and doesn't display the image.