当前位置: 代码迷 >> PHP >> 新手php日历有关问题
  详细解决方案

新手php日历有关问题

热度:83   发布时间:2016-04-28 19:18:58.0
新手求助php日历问题
<html>
    <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
        <style>
            .tdborder{
                border: 1px solid red;
            }
        </style>
        <script type="text/javascript">

            function test(){
               var tb = document.getElementsByTagName("table")[0];
               var trs = tb.getElementsByTagName("tr");



               for(var i=0;i<trs.length;i++){
                   var td = trs[i].firstChild;
                   var tdl = trs[i].lastChild;

                   td.setAttribute("style","color:red");
                   tdl.setAttribute("style","color:red");


               }

                var tds = tb.getElementsByTagName("td");
                for(var j=0;j<tds.length;j++){

                    tds[j].onmouseover = function(){
                        for(var k=0;k<tds.length;k++){
                            tds[k].className="";
                        }
                        this.className="tdborder";
                    }

                    tds[j].onclick = function(e){
                        var div = document.getElementsByTagName("div");
                        for(var a=0;a<div.length;a++){
                            document.body.removeChild(div[a]);
                        }
//                        var w = this.cellIndex;
//                        alert(w);
                        var e = e || window.event;
                        var day = this.innerHTML;
                        var d = document.createElement("div");
                        d.style.border = "1px solid red";
                        d.style.position = "absolute";
                        d.style.zIndex = 22;
                        d.style.left = e.clientX+20 + "px";
  相关解决方案