login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > JS > Kalenders > Kalender

Kalender

Auteur: Insane - 04 september 2004 - 11:57 - Gekeurd door: Dennisvb - Hits: 11041 - Aantal punten: 2.50 (7 stemmen)





Gewoon knippen en plakken...heel makkelijk aan te passen!
Wel engels aanpassen!

Code:
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <script language='javascript'>
  6.  
  7. var cdrWdth='180'; // Changes the width of the calendar
  8. var mainBg='#000088'; // Changes the color of the main background
  9. var mainTxt='#BBBBFF'; // Changes the color of the main text
  10. var currCellBg='#124488'; // Changes the background of the square around the current day
  11. var currCellBdr=1; // Changes the border on the square around the current day
  12. var currCellTxt='#FFFFFF'; // Changes the color of the text of the current day
  13. var titleRwBg='#000000'; // Changes the background of the month and year cell
  14. var titleRwTxt='#FFFFFF'; // Changes the text of the month and year cell
  15. var dayCol='#5599FF'; // Changes the color of the names of the days
  16.  
  17. // Do not edit below this point unless you know how to write javascript
  18.  
  19. var now=new Date();
  20.  
  21. var mthNames="January February March April May June July August September October November December";
  22. var mthNames=mthNames.split(" ");
  23. var wkDays="Sun,Mon,Tue,Wed,Thu,Fri,Sat";
  24. var mthLengths="31,28,31,30,31,30,31,31,30,31,30,31";
  25. var mthLengths=mthLengths.split(",");
  26. var yrFig=(now.getYear()/4)+"";
  27. var yrFig2=now.getYear()+"";
  28. if ( yrFig.indexOf(".") != -1 ) { mthLengths[1]="29"; }
  29. var wkDays=wkDays.split(",");
  30. var theMthLength=mthLengths[now.getMonth()]*1;
  31.  
  32. var fstDay=new Date();
  33. fstDay.setDate(1);
  34. var firstDay=wkDays[fstDay.getDay()];
  35.  
  36. var spaceNum=fstDay.getDay()-1;
  37. if ( fstDay.getDay()==0 ) { var spaceNum=6; }
  38.  
  39. var cell=new Array;
  40. var loop=0;
  41.  
  42. while ( loop<spaceNum )
  43. {
  44.  
  45. cell[loop]="";
  46. loop++;
  47.  
  48. }
  49. var loop2=0;
  50.  
  51. while ( loop2<theMthLength )
  52. {
  53.  
  54. cell[loop+loop2]="<font color='"+mainTxt+"'>"+(loop2+1);
  55. if ( loop2+1==now.getDate() ) { cell[loop+loop2]="<table height='80%' width='80%' border='"+currCellBdr+"' bordercolor='#000000' cellpadding='0' cellspacing='0'><tr><td bgcolor='"+currCellBg+"' align='center'><b><font color='"+currCellTxt+"'>"+(loop2+1)+"</font></b></td></tr></table>"; }
  56. loop2++;
  57.  
  58. }
  59.  
  60. document.write("<table bgcolor='"+mainBg+"' cellspacing='0' cellpadding='0' width='"+cdrWdth+"'>");
  61.  
  62. document.write("<tr><td colspan='7' bgcolor='"+titleRwBg+"' align='center'><b><font color='"+titleRwTxt+"'>"+mthNames[now.getMonth()]+" "+now.getYear()+"</font></b></td></tr>");
  63.  
  64. document.write("<tr><td><font color='"+dayCol+"'>Mon</td><td><font color='"+dayCol+"'>Tue</td><td><font color='"+dayCol+"'>Wed</td><td><font color='"+dayCol+"'>Thu</td><td><font color='"+dayCol+"'>Fri</td><td><font color='"+dayCol+"'>Sat</td><td><font color='"+dayCol+"'>Sun</td></tr><tr>");
  65.  
  66. var loop3=0;
  67.  
  68. while ( loop3 < cell.length )
  69. {
  70.  
  71. document.write("<td align='center'>"+cell[loop3]+"</td>");
  72. loop3++;
  73. if (( loop3==7 ) || ( loop3==14 ) || ( loop3==21 ) || ( loop3==28 ) || ( loop3==35 )) { document.write("</tr><tr>"); }
  74.  
  75. }
  76.  
  77. document.write("</tr></table>");
  78.  
  79. </script>
  80. </body>
  81. </html>
Download code! Download code (.txt)

 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (4)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.027s