|
用JAVASCRIPT实现的几个小特效(二) |
|
在我们的主页中常常用到主页的最后更新日期;另外当你的友情连接比较多的时候,你往往想要用到一个下拉式菜单。这两项功能的源程序如下:
<!-- Last Modified Starting Here --> <SCRIPT LANGUAGE="JavaScript"> function initArray() { this.length = initArray.arguments.length for (var i = 0; i < this.length; i++) this[i+1] = initArray.arguments[i] } var WeekArray = new initArray("周日","周一","周二","周三","周四","周五","周六"); var MonthArray = new initArray("一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"); var LastModDate = new Date(document.lastModified); document.write(LastModDate.getYear(),","); document.write(MonthArray[(LastModDate.getMonth()+1)]," "); document.write(LastModDate.getDate()+","); document.write(WeekArray[(LastModDate.getDay()+1)]); </script> <!-- End of Last Modified --> <!-- PullDown Menu Code Started. --> <form name='PulldownMenu'> <select name='menu' size=1> <option value='http://www.oso.com.cn'>奥索网</option> <option value='http://www.yahoo.com'>YAHOO</option> <option value='http://spedia.oso.com.cn'>中国广告网</option> </select> <input type="button" onclick="window.location.href=PulldownMenu.menu.options[PulldownMenu.menu.selectedIndex].value" value="GO"> </form> <!-- End of Code --> |