不要进入.on("点击")功能

时间:2018-04-03 06:48:48

标签: javascript jquery typescript onclick

我无法弄清楚为什么我的代码不会进入点击功能。我做错了什么?

let allDivsOnTheRightPane = rightPane.contents().find(".x-panel-body-noheader > div");
//change height of all expanded divs due to the newly added cases tab -->

        allDivsOnTheRightPane.not(casesTabHTML).each(function(){
            let self = this;
            let header = self.childNodes[0];
            console.log(header); // element is found properly
            $(header).on( "click", function () { // the debugger is not going inside and jumps to the end 
                let currentDiv = $(this).get(0); 
                $(this).arrive(".x-panel-body", arriveOptions, function () {
                    let xPanel = currentDiv.getElementsByTagName("div")[2];
                    let xPanelSub = xPanel.getElementsByTagName("div")[0];
                    let xPanelSubSub = xPanelSub.getElementsByTagName("div")[0];
                    let currentHeight = $(xPanelSub).height();
                    let newHeight = (currentHeight - 30) + "px";
                    $(xPanelSub).css("height", newHeight);
                    $(xPanelSubSub).css("height", newHeight);
                });
            });
        });

1 个答案:

答案 0 :(得分:0)

如上所述,只有在执行单击后,调试器才会进入.on(“click”..)函数。