Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 20 odgovora
  • 7.361 pregleda

Najnovija ↓

Može li netko uredit ili rec kako?? 27.11.2004. u 23:45 · pre 266 meseci #1
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 -->
Potpis
gogy
Re: Može li netko uredit ili rec kako?? 28.11.2004. u 09:29 · pre 266 meseci #2
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;
}
Potpis
Banned - Not available
Re: Može li netko uredit ili rec kako?? 28.11.2004. u 10:42 · pre 266 meseci
izmenjeno 1 put, poslednji put Br@nkoR 28.11.2004. u 10:56
  1. Br@nkoR28.11.2004. u 10:56zapis iz teksta poruke
#3
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
Potpis
Banned - Not available
Re: Može li netko uredit ili rec kako?? 28.11.2004. u 10:55 · pre 266 meseci #4
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>");
Potpis
Banned - Not available
Re: Može li netko uredit ili rec kako?? 28.11.2004. u 15:30 · pre 266 meseci #6
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-----
Potpis
gogy
Re: Može li netko uredit ili rec kako?? 28.11.2004. u 15:58 · pre 266 meseci #7
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
Potpis
http://www.activecollab.com - Alat za upravljanje projektima
Re: Može li netko uredit ili rec kako?? 28.11.2004. u 20:21 · pre 266 meseci #9
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!!
Potpis
gogy
Re: Može li netko uredit ili rec kako?? 28.11.2004. u 22:01 · pre 266 meseci #11
Na velicinu kalendara mozes uticati velicinom fonta , a za bg sliku stavis bg za table ( mozes i prko css-a )
Potpis
Aj sad svi u biblioteku da nesto pojedemo i popijemo ...
--------------------------------
Knjigovodstvo

Re: Može li netko uredit ili rec kako?? 29.11.2004. u 10:32 · pre 266 meseci #12
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.
Potpis
Banned - Not available
Re: Može li netko uredit ili rec kako?? 29.11.2004. u 10:38 · pre 266 meseci #13
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.
Potpis
Banned - Not available
Re: Može li netko uredit ili rec kako?? 29.11.2004. u 20:36 · pre 266 meseci #14
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<<<<<<
Potpis
gogy
Re: Može li netko uredit ili rec kako?? 29.11.2004. u 21:09 · pre 266 meseci #19
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
Potpis
gogy
Re: Može li netko uredit ili rec kako?? 29.11.2004. u 22:58 · pre 266 meseci #20
"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?
Potpis
BoxUp
interesantna logička igra
Monty Hall paradoks - interaktivni demo
Odgovori
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme