|
|
Ŭ¶ó¿ìµåű×
Javascript PHP ASP css html mysql jquery image API Mobile ¸Þ´º slide °Ô½ÃÆÇ
|
|
|
ÇöÀçÁ¢¼ÓÀÚ ¸í |
|
|
|
|
|
|
|
³¯Â¥ÀÔ·Â |
|
|
|
|
¼Ò½ººÐ·ù |
½Ã°£,³¯Â¥ |
|
|
´Ù¿î·Îµå Ƚ¼ö |
663 ȸ |
|
|
|
°£´Ü¼³¸í |
Æ˾÷â¿¡ Ä«·»´Ù¸¦ ¿¾î¼ ³¯ÀÚ¸¦ ¸ÞÀÎâ¿¡ ÀÔ·Â ½ÃÅ°±â ^_^ |
|
|
|
|
|
<script language="JavaScript"><br />
/* Autor: Jorge Ortiz Giraldo e-mail: jortizg@hotmail.com */<br />
nombresMes = Array("","january","february","march","april","may","june","july","august","september","october","november","december");<br />
var anoInicial = 1900;<br />
var anoFinal = 2100;<br />
var ano;<br />
var mes;<br />
var dia;<br />
var campoDeRetorno;<br />
var titulo;<br />
<br />
function diasDelMes(ano,mes) {<br />
if ((mes==1)||(mes==3)||(mes==5)||(mes==7)||(mes==8)||(mes==10)||(mes==12)) dias=31<br />
else if ((mes==4)||(mes==6)||(mes==9)||(mes==11)) dias=31<br />
else if ((((ano % 100)==0) && ((ano % 400)==0)) || (((ano % 100)!=0) && ((ano % 4)==0))) dias = 29<br />
else dias = 28;<br />
return dias;<br />
};<br />
<br />
function crearSelectorMes(mesActual) {<br />
var selectorMes = "";<br />
selectorMes = "<select name=``mes`` size=``1`` onChange=``javascript:opener.dibujarMes(self.document.Forma1.ano[self.document.Forma1.ano.selectedIndex].value,self.document.Forma1.mes[self.document.Forma1.mes.selectedIndex].value);``><br />
";<br />
for (var i=1; i<=12; i++) {<br />
selectorMes = selectorMes + " <option value=``" + i + "``";<br />
if (i == mesActual) selectorMes = selectorMes + " selected";<br />
selectorMes = selectorMes + ">" + nombresMes[i] + "</option><br />
";<br />
}<br />
selectorMes = selectorMes + "</select><br />
";<br />
return selectorMes;<br />
}<br />
<br />
function crearSelectorAno(anoActual) {<br />
var selectorAno = "";<br />
selectorAno = "<select name=``ano`` size=``1`` onChange=``javascript:opener.dibujarMes(self.document.Forma1.ano[self.document.Forma1.ano.selectedIndex].value,self.document.Forma1.mes[self.document.Forma1.mes.selectedIndex].value);``><br />
";<br />
for (var i=anoInicial; i<=anoFinal; i++) {<br />
selectorAno = selectorAno + " <option value=``" + i + "``";<br />
if (i == anoActual) selectorAno = selectorAno + " selected";<br />
selectorAno = selectorAno + ">" + i + "</option><br />
";<br />
}<br />
selectorAno = selectorAno + "</select>";<br />
return selectorAno;<br />
}<br />
<br />
function crearTablaDias(numeroAno,numeroMes) {<br />
var tabla = "<table border=``0`` cellpadding=``2`` cellspacing=``0`` bgcolor=``#ffffff``><br />
<tr>";<br />
var fechaInicio = new Date();<br />
fechaInicio.setYear(numeroAno);<br />
fechaInicio.setMonth(numeroMes-1);<br />
fechaInicio.setDate(1);<br />
ajuste = fechaInicio.getDay();<br />
tabla = tabla + "<br />
<td align=``center``>Su</td><td align=``center``>Mo</td><td align=``center``>Tu</td><td align=``center``>We</td><td align=``center``>Th</td><td align=``center``>Fr</td><td align=``center``>Sa</td></div><br />
<tr>";<br />
for (var j=1; j<=ajuste; j++) {<br />
tabla = tabla + "<br />
<td></td>";<br />
}<br />
for (var i=1; i<10; i++) {<br />
tabla = tabla + "<br />
<td"<br />
if ((i == diaHoy()) && (numeroMes == mesHoy()) && (numeroAno == anoHoy())) tabla = tabla + " bgcolor=``#ff0000``";<br />
tabla = tabla + "><input type=``button`` value=``0" + i + "`` onClick=``javascript:opener.ano=self.document.Forma1.ano[self.document.Forma1.ano.selectedIndex].value; opener.mes=self.document.Forma1.mes[self.document.Forma1.mes.selectedIndex].value; opener.dia=" + i + "; self.close();``></td>";<br />
if (((i+ajuste) % 7)==0) tabla = tabla + "<br />
</tr><br />
<tr>";<br />
}<br />
for (var i=10; i<=diasDelMes(numeroAno,numeroMes); i++) {<br />
tabla = tabla + "<br />
<td"<br />
if ((i == diaHoy()) && (numeroMes == mesHoy()) && (numeroAno == anoHoy())) tabla = tabla + " bgcolor=``#ff0000``";<br />
tabla = tabla + "><input type=``button`` value=``" + i + "`` onClick=``javascript:opener.ano=self.document.Forma1.ano[self.document.Forma1.ano.selectedIndex].value; opener.mes=self.document.Forma1.mes[self.document.Forma1.mes.selectedIndex].value; opener.dia=" + i + "; self.close();``></td>";<br />
if (((i+ajuste) % 7)==0) tabla = tabla + "<br />
</tr><br />
<tr>";<br />
}<br />
tabla = tabla + "<br />
</tr><br />
</table>";<br />
return tabla;<br />
}<br />
<br />
function dibujarMes(numeroAno,numeroMes) {<br />
var html = "";<br />
html = html + "<html><br />
<head><br />
<title>" + titulo + "</title><br />
</head><br />
<body bgcolor=``#ffffff`` onUnload=``opener.escribirFecha();``><br />
<div align=``center``><br />
<form name=``Forma1``><br />
";<br />
html = html + crearSelectorMes(numeroMes);<br />
html = html + crearSelectorAno(numeroAno);<br />
html = html + crearTablaDias(numeroAno,numeroMes);<br />
html = html + "<center><p><input type=``button`` name=``hoy`` value=``today: " + dia + "/" + mes + "/" + ano + "`` onClick=``javascript:self.close();``></center>";<br />
html = html + "<br />
</form><br />
</div><br />
</body><br />
</html><br />
";<br />
ventana = open("","calendario","width=220,height=270");<br />
ventana.document.open();<br />
ventana.document.writeln(html);<br />
ventana.document.close();<br />
ventana.focus();<br />
}<br />
<br />
function anoHoy() {<br />
var fecha = new Date();<br />
if (navigator.appName == "Netscape") return fecha.getYear() + 1900<br />
else return fecha.getYear();<br />
}<br />
<br />
function mesHoy() {<br />
var fecha = new Date();<br />
return fecha.getMonth()+1;<br />
}<br />
<br />
function diaHoy() {<br />
var fecha = new Date();<br />
return fecha.getDate();<br />
}<br />
<br />
function pedirFecha(campoTexto,nombreCampo) {<br />
ano = anoHoy();<br />
mes = mesHoy();<br />
dia = diaHoy();<br />
campoDeRetorno = campoTexto;<br />
titulo = nombreCampo;<br />
dibujarMes(ano,mes);<br />
}<br />
<br />
function escribirFecha() {<br />
campoDeRetorno.value = dia + "/" + mes + "/" + ano;<br />
}<br />
<br />
</script>
|
|
³×ƼÁð ÀÇ°ß ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.) |
|