Xanga date:
| example: | ||
| ||
| code: | ||
| <style type = "text/css"> /* edit the date */ div.blogheader, .caption{ width: 300px; border: 1px solid #999999; background-color: #6699ff; background-image: none; text-align: right; font-family: verdana; font-size: 15px; font-color: #000000; color: #000000; font-weight: bold; } </style> |
width 可用 px / % | |
| border 可用 solid / dotted / dashed / double / groove / ridge / inset / outset | ||
| 如有 bg image 的話, background-image: url("http://......"); | ||
| text-align 可用 left / center / right | ||
| font-family 即 字型 | ||
| bold 即 粗體 | ||
| * 如該項無需要的話, 打 none 即可 | ||
請自行修改紅色字o既地方
Xanga date 改字:
| example: | |
| |
| code: | |
| <script type="text/javascript"> // ==================== // listing of available constants (using date // "Tuesday, March 16, 2004" as an example): // dd = 16 // ddd = Tue // dddd = Tuesday // mm = 03 // mmm = Mar // mmmm = March // yy = 04 // yyyy = 2004 // ==================== function formatEntryDate() { // adjust the dateFormatStr below as you see fit // ======================================== dateFormatStr = '<table width="75%"><tr><td style="border-top: none; border-bottom: 2px dashed #999999; border-left: none; border-right: none; background-color: #ffccff; background-image: none; text-align: left; font-family: verdana; font-size: 15px; font-color: #000000; font-weight: bold;">* dd-mmm-yyyy ddd = ]</td></tr></table>'; // ======================================== function getMonthNr(sMonth) { months = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); for (var n = 0; n < months.length; ++n) { if (months[n] == sMonth) { if ( n + 1 < 10) return '0' + (n + 1).toString() else return (n + 1).toString(); } } } allDivs = document.getElementsByTagName('div'); for (var i = 0; i < allDivs.length; ++i) { if (allDivs[i].className == 'blogheader') { newDateFormat = dateFormatStr; entryDate = allDivs[i].innerHTML; // day dayLong = entryDate.substr(0, entryDate.indexOf(',')); // dddd dayShort = dayLong.substr(0, 3); // ddd tempStr = entryDate.substr(dayLong.length + 1); dayNr = tempStr.substr(tempStr.indexOf(',') - 2, 2); // dd newDateFormat = newDateFormat.replace('dddd', dayLong); newDateFormat = newDateFormat.replace('ddd', dayShort); newDateFormat = newDateFormat.replace('dd', dayNr); // month monthLong = tempStr.substr(1, tempStr.indexOf(',') - 3); // mmmm monthShort = monthLong.substr(0, 3); // mmm monthNr = getMonthNr(monthShort); // mm newDateFormat = newDateFormat.replace('mmmm', monthLong); newDateFormat = newDateFormat.replace('mmm', monthShort); newDateFormat = newDateFormat.replace('mm', monthNr); // year yearLong = tempStr.substr(tempStr.indexOf(',') + 2); // yyyy yearShort = yearLong.substr(2); // yy newDateFormat = newDateFormat.replace('yyyy', yearLong); newDateFormat = newDateFormat.replace('yy', yearShort); allDivs[i].innerHTML = newDateFormat; } } } formatEntryDate(); </script> |
請自行修改紅色字o既地方