页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

...

代码块
themeEclipse
languagejs
firstline1
linenumberstrue
function main(spreadsheetReport) {
    var elems = spreadsheetReport.elemSheetFrame.contentWindow.document.getElementsByTagName("A");
    for (var i = 0; i < elems.length; i++) {
        var elem = elems[i];
        // 设置点击跳转前的字体颜色和下划线
        //设置字体颜色
        elem.firstChild.style.color = "#ffff00";
        //设置下划线颜色
        elem.style.color = "#ffff00";
        //隐藏下划线
		elem.style.textDecoration = "none";
     // elem   if (elem.firstElementChild) {
            elem.firstElementChild.style.textDecoration = "none";
        }
        if (elem.parentElement) {
            elem.parentElement.style.textDecoration = "none";
        }
        // 设置点击跳转后的字体颜色和下划线
        elem.onclick = function() {
            this.firstChild.style.color = "#fff00";
            this.style.color = "#0000ff";
            // this.style.textDecoration = "none";
        };
        // 鼠标移入时设置单元格背景色
        var c = elem.parentNode;
        spreadsheetReport.addListener(c, "mouseover",
        function() {
            this.style.backgroundColor = "#ff0000";
        },
        c);
        // 鼠标离开时设置单元格背景色
        spreadsheetReport.addListener(c, "mouseout",
        function() {
            this.style.backgroundColor = "#ffffff";
        },
        c);
    }
}
    

...