[ dude_87 @ 27.11.2004. 22:45 ] @
da li mi netko može sredit ovaj kalendar da lipo izgleda ako nemože možete li mi reci šta,di,kud,kamo da mjenjam a da ostane kalendar

code:::::
<script language="JavaScript">

<!-- Begin
monthnames = new Array(
"Siječan",
"Veljača",
"Ožujak",
"Travanj",
"Svibanj",
"Lipanj",
"Srpanj",
"Kolovoz",
"Rujan",
"Listopad",
"Studeni",
"Prosinac");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0)
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table border=0bgcolor=#456987");
document.write("bordercolor=blue><font color=blue>");
document.write("<tr><td colspan=7><center><strong>"
+ monthnames[thismonth] + " " + thisyear
+ "</strong></center></font></td></tr>");
document.write("<tr>");
document.write("<td align=center>Po</td>");
document.write("<td align=center>U</td>");
document.write("<td align=center>Sr</td>");
document.write("<td align=center>Č</td>");
document.write("<td align=center>Pe</td>");
document.write("<td align=center>S</td>");
document.write("<td align=center>Ne</td>");
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td>");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
document.write("<a href=\"" + linkdays[c][2] + "\">");
linktrue=true;
}
}
}
if (count==thisdate) {
document.write("<font color='336699'><strong>");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</strong></font>");
}
if (linktrue)
document.write("</a>");
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table></p>");
// End -->
[ Br@nkoR @ 28.11.2004. 08:29 ] @
Na šta misliš, ka da si rekao da lepo izgleda.

Ukoliko mislis na sam izgled kalendara, evo ti malo izmenjen JavaScript kod i CSS kojim ćeš sam moći da menjaš izgled kalendara u zavisnosti od izgleda tvog sajta:
Napomena: Ovo je rađeno na brzinu pa su moguće greške i testirano je samo u IE-u, nisam stigao da testiram u ostalim browserima.

JavaScript:

Code:

<script language="JavaScript">
<!-- Begin
monthnames = new Array(
"Sijecan",
"Veljaca",
"Ozujak",
"Travanj",
"Svibanj",
"Lipanj",
"Srpanj",
"Kolovoz",
"Rujan",
"Listopad",
"Studeni",
"Prosinac");
var linkcount=0;
function addlink(month, day, href) {
var entry = new Array(3);
entry[0] = month;
entry[1] = day;
entry[2] = href;
this[linkcount++] = entry;
}
Array.prototype.addlink = addlink;
linkdays = new Array();
monthdays = new Array(12);
monthdays[0]=31;
monthdays[1]=28;
monthdays[2]=31;
monthdays[3]=30;
monthdays[4]=31;
monthdays[5]=30;
monthdays[6]=31;
monthdays[7]=31;
monthdays[8]=30;
monthdays[9]=31;
monthdays[10]=30;
monthdays[11]=31;
todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));
if (((thisyear % 4 == 0) 
&& !(thisyear % 100 == 0))
||(thisyear % 400 == 0)) monthdays[1]++;
startspaces=thisdate;
while (startspaces > 7) startspaces-=7;
startspaces = thisday - startspaces + 1;
if (startspaces < 0) startspaces+=7;
document.write("<table id=\"calendar\"");
document.write("<tr><td colspan=7  id=\"month\">" 
+ monthnames[thismonth] + " " + thisyear 
+ "</td></tr>");
document.write("<tr id=\"date\">");
document.write("<td align=center>Po</td>");
document.write("<td align=center>U</td>");
document.write("<td align=center>Sr</td>");
document.write("<td align=center>C</td>");
document.write("<td align=center>Pe</td>");
document.write("<td align=center>S</td>");
document.write("<td align=center>Ne</td>"); 
document.write("</tr>");
document.write("<tr>");
for (s=0;s<startspaces;s++) {
document.write("<td class=\"days\"> </td>");
}
count=1;
while (count <= monthdays[thismonth]) {
for (b = startspaces;b<7;b++) {
linktrue=false;
document.write("<td class=\"days\">");
for (c=0;c<linkdays.length;c++) {
if (linkdays[c] != null) {
if ((linkdays[c][0]==thismonth + 1) && (linkdays[c][1]==count)) {
document.write("<a href=\"" + linkdays[c][2] + "\">");
linktrue=true;
}
}
}
if (count==thisdate) {
document.write("<div id=\"today\">");
}
if (count <= monthdays[thismonth]) {
document.write(count);
}
else {
document.write(" ");
}
if (count==thisdate) {
document.write("</div>");
}
if (linktrue)
document.write("</a>");
document.write("</td>");
count++;
}
document.write("</tr>");
document.write("<tr>");
startspaces=0;
}
document.write("</table></p>");
// End --> 
</script>


CSS:

Code:

#calendar {
font-family: Arial, Helvetica, sans-serif;
background-color: #666666;
border: 2px solid #000000;
}
#calendar #month {
background-color: #CCCCCC;
font-weight: bold;
text-align: center;
}
#calendar #date {
background-color: #999999;
}
#calendar #date td {
border: 1px solid #000000;
font-weight: bold;
}
#calendar .days {
background-color: #999999;
text-align: center;
}
#calendar #today {
color: #336699;
font-weight: bold;
background-color: #CCCCCC;
}
[ Br@nkoR @ 28.11.2004. 09:42 ] @
Pošto sajt nije u prethodnu poruku ubacio text [ovu poruku je menjao .... itd]
Izvršio sam neke izmene na u gornjem kodu.
Nisam video postojao je višak font taga i takođe je izmenjen font tag u prikazu trenutnog (današnjeg) datuma.

Pozdrav

[Ovu poruku je menjao Br@nkoR dana 28.11.2004. u 10:56 GMT+1]
[ Br@nkoR @ 28.11.2004. 09:55 ] @
Na ovo nisam obraćao pažnju ali ovaj kalendar ne prikazuje tačan datum, odnosno dan za odgovarajući datum. Tačnije danas je nedelja 28, a ovde je ponedeljak 28.

Proneni samo:
Code:

document.write("<td align=center>Po</td>");
document.write("<td align=center>U</td>");
document.write("<td align=center>Sr</td>");
document.write("<td align=center>C</td>");
document.write("<td align=center>Pe</td>");
document.write("<td align=center>S</td>");
document.write("<td align=center>Ne</td>"); 


U kod:
Code:

document.write("<td align=center>Ne</td>"); 
document.write("<td align=center>Po</td>");
document.write("<td align=center>U</td>");
document.write("<td align=center>Sr</td>");
document.write("<td align=center>C</td>");
document.write("<td align=center>Pe</td>");
document.write("<td align=center>S</td>");
[ dude_87 @ 28.11.2004. 14:11 ] @
sorry susjed ali možeš li mi reci kako da ubacim one kodeve za css nisam bas neki majstor???
[ dude_87 @ 28.11.2004. 14:30 ] @
Evo mene opet proba sam u css uvalit ali ide me kao da slona hocu uvalit misu u usta >>>>>možeš malo detaljnije objesniti kako to izvest<<<<<<<<
----- hvala-----
[ Ilija Studen @ 28.11.2004. 14:58 ] @
Najjednostavniji način da dodaš CSS je da otvoriš STYLE tag i dodaš stil:

Code:
<html>
  <head>
    <style> --> ovde dodaj sav CSS </style>
  </head>
  <body> ... </body>
</html>


Ili napravi jedan CSS fajl, sačuvaj ga negde u strukturi sajta i u HEAD dodaj LINK tag:


Code:
<html>
  <head>
    <link rel="stylesheet" href="put/do/css/fajla.css" type="text/css" />
  </head>
  <body> ... </body>
</html>


Poz
[ Br@nkoR @ 28.11.2004. 15:01 ] @
Pogledaj fajl uz poruku.
Kod je malo izmenjen.
Pozdrav.
[ dude_87 @ 28.11.2004. 19:21 ] @
Hvala na kalendaru da sam ga crtao nebi bolje samo imam još jedno pitanje htio bi da mi pozadina kalendara bude slika koju imam na kompicu ako nije problem možeš li mi reci di i kako da nju stavim
HVALA!!
[ dude_87 @ 28.11.2004. 20:22 ] @
sorry dosadia sam i sebi tek sam sada primjetia da je malo velik kalendar pa kako da ga smanjin probava sam sam ali nisam uspjeo
[ Radovan__III @ 28.11.2004. 21:01 ] @
Na velicinu kalendara mozes uticati velicinom fonta , a za bg sliku stavis bg za table ( mozes i prko css-a )
[ Br@nkoR @ 29.11.2004. 09:32 ] @
Da bi stavio pozadinu (background) stavi u #calendar kod:
Code:
background-image: url(slika.gif);

Gde je "slika.gif" tvoja slika ili putanja do tvoje slike.

Odnosno sve ukupno bi izgledalo ovako:
Code:

#calendar {
  font-family: Arial, Helvetica, sans-serif;
  background-color: #666666;
  border: 2px solid #000000;
  background-image: url(slika.gif);
}


A da bi smanjio kalendar iz sledeceg koda smanji samo width ili ga ukloni:
Code:

#calendar #date td {
  border: 1px solid #FFF;
  font-weight: bold;
  width: 25px;
}


Ovde sam width stavio samo da bi kalendar izgledao lepse, odnosno da bi kolone bile iste sirine.
Pozdrav.
[ Br@nkoR @ 29.11.2004. 09:38 ] @
Ovo sam zaboravio da napisem. Velicinu kalendara mozes da smanjis i kao sto je @Radovan__III napisao promenom velicine fonta ali prethodno moras da uklonis onaj width. Da bi pormenio velicinu fonta samo dodaj u #calendar:
Code:
font-size: 12px;

gde je 12px velicina fonta. Tu mozes staviti vrednost koja tebi odgovara.
[ dude_87 @ 29.11.2004. 19:36 ] @
Kalendar je prebolestan ludnica sredia sam ga majstorski zahvaljujem puno na pomoći još ću ja tebi poslat pitanja kada zapnem nebrini nisi me se još riješia:-))
NOVO PITANJE:
Znaš li slucajno gdje bi mogao naci neki dobar design da malo dobijem inspiracije za raditi neke bolesne design-e????
>>>>>>hvala<<<<<<
[ Br@nkoR @ 29.11.2004. 19:46 ] @
http://www.elitesecurity.org/tema/62359

Obavezno pogledaj i ostale TOP teme u ovom forumu.

[Ovu poruku je menjao Br@nkoR dana 29.11.2004. u 20:47 GMT+1]
[ noviKorisnik @ 29.11.2004. 19:47 ] @
hm, Branko,... a da mu se ponudi neki već dovoljno bolestan dizajn da ne mora više da te cima?
[ Br@nkoR @ 29.11.2004. 19:50 ] @
To bi bilo najbolje. ;)
[ sojic @ 29.11.2004. 20:04 ] @
A da pogledas ti ovaj link: http://www.dynarch.com/projects/calendar/
[ dude_87 @ 29.11.2004. 20:09 ] @
sorrry noviKorisnik ali šta ti znaći ""cima""???
Mislis cimavica pa ako coviku smetam ima prste i neka napiše dosadan si i bok!!! koliko me pamet služi svrha ovog foruma je da se nesto nauci
[ noviKorisnik @ 29.11.2004. 21:58 ] @
"cimati nekoga" kao suprotno od "naučiti nešto".

Gogy, možda grešim, ali nisam stekao utisak da si iz ovoga naučio puno. Zašto? Uskočio si negde na sredini, našao skript koji ti je simpatičan i poželeo da izgleda drugačije nemajući pojma zašto to radi ovako kako radi.

Uči se od početka.

Ovako možeš da rešiš neki svoj problem, odnosno da iskoristiš forum da ti neko reši konkretan problem, i to ne možda samo jednom, ali sigurno ne i uvek, jer ovo je ipak samo forum.

Dakle, koliko si naučio iz ove teme, a koliko je tema samo pomogla da kalendar izgleda kako si zamislio?
[ Br@nkoR @ 30.11.2004. 06:50 ] @
I jedno pitanje od mene:
Možemo li videti kako sada izgleda ovaj kalendar posle tvojih izmena?

Pozdrav.