スクリプト置き場 > 精霊図鑑ナビゲータ

「スクリプト置き場/精霊図鑑ナビゲータ」の編集履歴(バックアップ)一覧に戻る

スクリプト置き場/精霊図鑑ナビゲータ - (2013/11/17 (日) 05:54:28) のソース

#js(){{{
window.onload=questCalendar();

function overColor(elem){
    var color = "(top, #7b7b7b 0%, #cccccc 50%, #7d7d7d 100%)";
    elem.style.background = "#7b7b7b";
    elem.style.background = "-webkit-gradient(linear, left top, left bottom, color-stop(1.00, #7d7d7d), color-stop(0.50, #cccccc), color-stop(0.00, #7b7b7b))";
    elem.style.background = "-webkit-linear-gradient" + color;
    elem.style.background = "-moz-linear-gradient" + color;
    elem.style.background = "-o-linear-gradient" + color;
    elem.style.background = "-ms-linear-gradient" + color;
    elem.style.background = "linear-gradient" + color;
}

function normalColor(elem){
    var color = "(top, #b8b8b8 0%, #f5f5f5 50%, #a1a1a1 100%)";
    elem.style.background = "#b8b8b8";
    elem.style.background = "-webkit-gradient(linear, left top, left bottom, color-stop(1.00, #a1a1a1), color-stop(0.50, #f5f5f5), color-stop(0.00, #b8b8b8))";
    elem.style.background = "-webkit-linear-gradient" + color;
    elem.style.background = "-moz-linear-gradient" + color;
    elem.style.background = "-o-linear-gradient" + color;
    elem.style.background = "-ms-linear-gradient" + color;
    elem.style.background = "linear-gradient" + color;
}

function questCalendar(){
    var table = document.getElementById('dict_navi').children[0];
    table.style.padding = "2px";
    table.style.width= "600px";
    var rows = table.children[0].children;
    var height = String( rows[0].cells[0].scrollHeight - 5 );
    for( var i = 0; i < rows.length; i++ ) {
        var cells = rows[i].cells;
        for( var j = 0; j < cells.length; j++ ){
            var cell = cells[j];
            cell.style.border = "2px rgb(230, 230, 230) solid"
            if( cell.childNodes.length == 0 ) continue;
            cell.style.padding = "0px";
            cell.style.margin = "0px";
            cell.width = String(cell.clientWidth + 40 );
            cell.height= String(height);

            var link = cell.childNodes[0].childNodes[1].childNodes[1];
            normalColor(link);
            link.style.border = "1px rgb(150, 150, 150) solid"
            link.style.width   = "120px";
            link.style.height  = "100%";
            link.style.display = "block";
            link.style.lineHeight  = "25px";
            link.onmouseover = function(){ overColor(this); };
            link.onmouseout  = function(){ normalColor(this);  };
        }
    }
}
}}}