【问题标题】:Dojo tooltip not displaying in Internet explorerDojo 工具提示未显示在 Internet Explorer 中
【发布时间】:2012-09-12 15:22:55
【问题描述】:

我在下面有这段代码可以在文本旁边显示工具提示。

该代码在 firefox 和 chrome 中正常工作,但在 IE 8 和 IE9 中无法正常工作

var gridTooltip = new Tooltip({
                connectId: "grid1",
                selector: "td",
                position: ["above"],
                getContent: function(matchedNode){
                    var childNode = matchedNode.childNodes[0];
                    if(childNode.nodeType == 1 && childNode.className == "user") {
                        this.position = ["after"];
                        this.open(childNode);
                        return false;                
                    }
                    if(matchedNode.className && matchedNode.className == "user") {
                        this.position = ["after"];            
                    } else {
                        this.position = ["above"];                               
                    }

                    return matchedNode.textContent;
                }
            });

【问题讨论】:

    标签: javascript jquery css dojo


    【解决方案1】:

    我不认为 IE 不支持 textContent...

    尝试改变:

    return matchedNode.textContent;
    

    到:

    return matchedNode.textContent || matchedNode.innerText;
    

    或使用innerHTML。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-06
      • 1970-01-01
      • 2012-11-22
      • 2017-11-02
      • 2020-03-30
      • 1970-01-01
      相关资源
      最近更新 更多