Eu também tentei e ganhei muito. Depois de dominar os princípios de implementação dos efeitos especiais do calendário do JS, quero adicionar mais funções e pode tocá -lo livremente. Deixe -me compartilhar aqui primeiro. Se você estiver interessado, pode tentar!
Este artigo compartilha os exemplos de JS para implementar efeitos de calendário com calendários lunares e outras informações. O volume de código é muito grande para sua referência. O conteúdo específico é o seguinte
Imagem de reprodução:
Código de implementação:
<html> <head> <title> Calendário perpétuo </ititle> <meta content = "calendário lunar; calendário solar; calendário mensal; festival; fuso horário; termo solar; oito caracteres; caules e ramos; zodíaco; solar gregoriano lunar; calendário chinês; calendar;" " nome = palavras-chave> <meta content = all name = robots> <meta content = "calendário solar gregoriano e calendário lunar chinês" nome = descrição> <meta charset = "utf-8"/> <style type = "text/css"> body {margin: 0px; preenchimento: 0px; } </style> </ad Head> <body> <Center> <br> <tabela CellPadding = "0" CellPacing = "0" id = "1"> <tr> <td> <ylem> #cal {width: 434px; Border: 1px Solid #C3D9FF; tamanho de fonte: 12px; margem: 8px 0 0 15px; } #cal #top {altura: 29px; altura da linha: 29px; Antecedentes: #e7eef8; Cor: #003784; preenchimento-esquerda: 30px; } #cal #top selecione {font-size: 12px; } #cal #top input {preenchimento: 0; } #cal ul #wk {margem: 0; preenchimento: 0; Altura: 25px; } #cal ul #wk li {float: esquerda; Largura: 60px; Alinhamento de texto: centro; altura de linha: 25px; estilo de lista: nenhum; } #cal ul #wk li b {font-weight: normal; Cor: #C60B02; } #cal #cm {clear: esquerda; Top de borda: 1px Solid #DDD; fundo de borda: 1px pontilhado #DDD; Posição: relativa; } #Cal #CM .Cell {Posição: Absolute; Largura: 42px; Altura: 36px; Alinhamento de texto: centro; margem: 0 0 0 9px; } #cal #cm .cell .so {font: Bold 16px Arial; } #cal #bm {text-align: certo; Altura: 24px; altura da linha: 24px; preenchimento: 0 13px 0 0; } #cal #bm a {color: 7977ce; } #cal #fd {display: Nenhum; Posição: Absoluto; Border: 1px Solid #DDDDF; Antecedentes: #feffcd; preenchimento: 10px; altura da linha: 21px; Largura: 150px; } #cal #fd b {font-weight: normal; Cor: #C60A00; } </style> <!-[se ie]> <ysty> #cal #top {padding-top: 4px;} #cal #top input {width: 65px;} #cal #fd {width: 170px;} </style> <! [endif]-> <d id = " id = "top"> agenda <leclect> </leclect> Ano <Seclect> </leclect> Ano <Seclect> </leclect> Ano <Feclect> </select> ano <select> </leclect> ano <select> </leclect> ano <Seclect> </leclect> Ano <Feclect> </select> <select> </select> Ano </select> </select> ye AR <Lelect> </select> Ano <Seclect> </select> Ano <leclect> </select> ano <select> </select> ano <select> </select> ano <select> </select> ano <select> </leclect> </select> </select> Ano </select> </select> <select> </select> ano <eclect> </s Elect> Ano <SELECLEM> </leclect> Ano <SELECLE> </select> Ano <Seclect> </select> ano <select> </select> Ano <Seclect> </leclect> ano <select> </select> ano <select> </leclect> Ano <Seclect> </select> Ano <leclect> </ecrelect> ano </select> Ano <e lect> </select> ano <leclect> </leclect> Ano <Seclect> </leclect> Ano <Feclect> </select> ano <select> </select> ano <select> </select> ano <select> </select> ano <Seclect> </leclect> </select> </select> ano <select> </select> <select> </select> C ({'fm': 'alop', 'title': this.innerhtml, 'url': this.href, 'p1': al_c (this), 'p2': 1}) "href =" javascript: void (0) "> hoje </a> </body> <script linguagem = "javascript"> <!-(function () {var s = Navigator.userAgent.indexOf ("msie")! 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, 0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0a2, 0x095b0, 0x14977, 0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, 0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, 0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, 0x06ca0, 0x0b550, 0x15355, 0x04DA0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, 0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, 0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, 0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, 0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, 0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, 0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, 0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20a4b0, 0x0a5, 0x1b255, 0x0a4b0, 0x0a5, 0x1b255, 0x0a4b0, 0x0aa5, 0x1b255, 0x0a4b0, 0x0aa5, 0x1b255, 0x0a4b0, 0x10a. Ding wu ji geng xin ren gui "; var j =" zi chou yin mao chen si si wu wei shen you xu hai "; var o =" rato, boi, tigre, coelho, dragão, snakhh, havaln, mola, mola, frango, cão "; "Qingming", "Great Rain", "Beginning of Summer", "Little Man", "Graining Seeds", "Summer Solar", "Little Heat", "Large Heat", "Great Heat", "Bird of Autumn", "Dragon Heat", "Frost Dew", "Frost Dew", "Bird of Winter", "Light Snow", "High Snow", "Winter Solstice"]; var D = [0, 21208, 43467, 63836, 85337, 107014, 128867, 150921, 173149, 195551, 218072, 240693, 263343, 285989, 308563, 3310333550, 375989, 39744, 3310333, 333350, 375989, 397444, 331033550, 33330, 33330, 333350, 39747, 33103350, 333350, 333350, 333350, 333350, 333350, 333350, 333350, 333350, 333350, 333350, 333350, 333350, 333350, 333350. 483532, 504758]; "0101": "*1 New Year's Day", "0214": "Valentine's Day", "0305": "Learn from Lei Feng's Memorial Day", "0308": "Women's Day", "0312": "Arbor Day", "0315": "Consumer Rights Day", "0401": "April's Day", "0501": "*1 Labor Day", "0504": "DIA da juventude", "0601": "Dia Internacional da Criança", "0701": "Aniversário do Partido Comunista da China", "0801": "Day do exército", "0910": "China" Day "," 1001 ". "*2 Festival de Primavera", "0115": "Festival da Lanterna", "0505": "*1 Dragon Boat Festival", "0815": "*1 Festival no meio do outo New Date (31556925974.7 * (J - 1900) + D [i] * 60000) + DATA.UTC (1900, 0, 6, 2, 5); h)? 15)} função e (h) {return ((p [i - 1900] & (65536 >> h))? 30: 29)} função c (m) {var k, j = 0, h = 0; 2050 && n> 0; (j> 0 && k == (j + 1) && this.isleap == false) {--k; }} 10? G (h.getdate (); Break, caso 30: J = "Break; this.solardate = f (y, "d"); this.lunarmonth = x.month; this.lunardate); this.restdays = 0; "d")) {this.showinlunar = this.jieqi = l [(this.solarmonth - 1) * 2 + 1]} if (c (this.solaryear, (this.solarmonthinmming - 1) * 2 + 1]} if (this.showinNar == "qingmming") * { } this.solarfestival = v [f (y, "mm") + f (y, "dd")]; parsent (regexp. $ 1); G (this.lunarmonth) + g (this.lunardate)]; this.restdays: parseint (regexp. $ 1); } this.showinlunar = (this.lunarfestival == "")? X.lines = 0; } função c (a, b) {a.setdate (a.getdate () + b); G (a.solaryear, a.solarmonth- 1)) / 7); X.datearray [e] = nulo; {init: function (a) {z (a)}, getjson: function () {return x}}}) (); M ("Top" função b (g) {c [g.solaryear - 1901]. I = novo U (New Date (J, 3, 1)); U (g); H.SELECTIVO DO {D (G.Solaryear, G.Solarmonth); }) (); {continua} var x = r ("div"); Math.Floor (A / 7) * 38 + 2 + PX "; Y = R "Div"); F.Hide ()}; (Argumentos.Length> 1) {var B = /(.*+?^=! "G"); "#{solaryear} ano#{solarmonth} mês {solardate} dia#{solarweekdayinchinese}"; "<br>#{ganzhiyear} ano#{ganzhimonth} mês#{ganzhidate} dia"; #{jieqi} </b> "} c.innerhtml = y (c, a); c.style.top = z.offsetTop + z.offsetHeight - 5 +" px "; c.style.left = z.OffsetLeft + z.fsetWidth" 5 + "px"; c. c. C.style.display = "None"} retornar {show: function (z) {g (z)}, hide: function () {x ()}, init: function (z) {c = z}}}) (); "http://zh.wikipedia.org/zh-cn/" + x.solarmonth + "%e6%9c%88" + x.solardate + "%e6%97%a5"} Return {setLink: function (x) {c (x) (s); Window.attachevent ("Onload", function () {W.Reset (a)})} w.init (a);O exposto acima é tudo sobre este artigo, espero que seja útil para todos aprenderem a programação de JavaScript.