<bdo id='Dwepu'></bdo><ul id='Dwepu'></ul>

      <small id='Dwepu'></small><noframes id='Dwepu'>

      <i id='Dwepu'><tr id='Dwepu'><dt id='Dwepu'><q id='Dwepu'><span id='Dwepu'><b id='Dwepu'><form id='Dwepu'><ins id='Dwepu'></ins><ul id='Dwepu'></ul><sub id='Dwepu'></sub></form><legend id='Dwepu'></legend><bdo id='Dwepu'><pre id='Dwepu'><center id='Dwepu'></center></pre></bdo></b><th id='Dwepu'></th></span></q></dt></tr></i><div id='Dwepu'><tfoot id='Dwepu'></tfoot><dl id='Dwepu'><fieldset id='Dwepu'></fieldset></dl></div>
      <legend id='Dwepu'><style id='Dwepu'><dir id='Dwepu'><q id='Dwepu'></q></dir></style></legend><tfoot id='Dwepu'></tfoot>
    1. 如何调试 CSS/Javascript 悬停问题

      How to debug CSS/Javascript hover issues(如何调试 CSS/Javascript 悬停问题)
        <bdo id='beRcu'></bdo><ul id='beRcu'></ul>
        <i id='beRcu'><tr id='beRcu'><dt id='beRcu'><q id='beRcu'><span id='beRcu'><b id='beRcu'><form id='beRcu'><ins id='beRcu'></ins><ul id='beRcu'></ul><sub id='beRcu'></sub></form><legend id='beRcu'></legend><bdo id='beRcu'><pre id='beRcu'><center id='beRcu'></center></pre></bdo></b><th id='beRcu'></th></span></q></dt></tr></i><div id='beRcu'><tfoot id='beRcu'></tfoot><dl id='beRcu'><fieldset id='beRcu'></fieldset></dl></div>
      • <tfoot id='beRcu'></tfoot>
          <tbody id='beRcu'></tbody>

        1. <legend id='beRcu'><style id='beRcu'><dir id='beRcu'><q id='beRcu'></q></dir></style></legend>

                <small id='beRcu'></small><noframes id='beRcu'>

              • 本文介绍了如何调试 CSS/Javascript 悬停问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我经常发现自己想要调试 CSS 布局问题,这些问题涉及由 Javascript 引起的 DOM 更改,以响应悬停事件或由于 :hover 选择器而应用的不同 CSS 规则.

                I often find myself wanting to debug CSS layout issues that involve DOM changes caused by Javascript in reaction to a hover event or different CSS rules applying due to the :hover selector.

                通常,我会使用 Firebug 来检查给我带来麻烦的元素,看看它的 CSS 属性是什么,以及这些属性来自哪里.但是,当涉及到悬停时,就变得不可能了,因为一旦您将鼠标向下移动到 Firebug 面板,您感兴趣的元素就不再悬停,适用的 CSS 规则不同,并且(在这种情况下JS 悬停) DOM 已更改.

                Normally, I'd use Firebug to inspect the element that's giving me trouble and see what its CSS properties were, and where those properties come from. However, when hovering is involved, it becomes impossible, because as soon as you move your mouse down to the Firebug panel, the elements you're interested in are no longer hovered, the CSS rules that apply are different, and (in the case of JS hovers) the DOM is changed.

                有什么方法可以冻结" DOM 的状态和 :hover 的应用程序,以便在 悬停事件期间检查 DOM?

                Is there any way I can "freeze" the state of the DOM and application of :hover in order to inspect the DOM as it was during a hover event?

                当然,欢迎任何其他关于如何调试此类问题的想法.

                Any other ideas on how to debug this sort of issue are welcome, of course.

                推荐答案

                onmouseover 函数处理程序添加到采用 :hover 的元素.在该函数中,对您想了解的任何元素调用 console.info(element).

                Add an onmouseover function handler to the element that is taking the :hover. Inside that function, call console.info(element) on whichever element you'd like to know about.

                myHoverElement.onmouseover = function() {
                    console.info(document.getElementById("someotherelementofinterest"));
                };
                

                当您在 firebug 活动的情况下运行此操作时,该元素将可用于在 firebug 控制台中检查.

                When you run this with firebug active, the element will be available to inspect in the firebug console.

                这篇关于如何调试 CSS/Javascript 悬停问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                ChartJS Version 3 - common legend for multiple line charts(ChartJS 版本 3 - 多个折线图的常用图例)
                Charts.js scales yaxes ticks min max doesnt work(Charts.js 缩放 yaxes 刻度 min max 不起作用)
                How to expand the slice of donut chart in chartjs?(如何在chartjs中扩展圆环图的切片?)
                Chart.js yAxes Ticks stepSize not working (fiddle)(Chart.js yAxes Ticks stepSize 不起作用(小提琴))
                Rounded corners on chartJS v.2 - bar charts (with negative values)(chartJS v.2 上的圆角 - 条形图(带负值))
                How to hide value in Chart JS bar(如何在 Chart JS 栏中隐藏值)

                1. <legend id='tdE6k'><style id='tdE6k'><dir id='tdE6k'><q id='tdE6k'></q></dir></style></legend>
                    <bdo id='tdE6k'></bdo><ul id='tdE6k'></ul>
                  • <i id='tdE6k'><tr id='tdE6k'><dt id='tdE6k'><q id='tdE6k'><span id='tdE6k'><b id='tdE6k'><form id='tdE6k'><ins id='tdE6k'></ins><ul id='tdE6k'></ul><sub id='tdE6k'></sub></form><legend id='tdE6k'></legend><bdo id='tdE6k'><pre id='tdE6k'><center id='tdE6k'></center></pre></bdo></b><th id='tdE6k'></th></span></q></dt></tr></i><div id='tdE6k'><tfoot id='tdE6k'></tfoot><dl id='tdE6k'><fieldset id='tdE6k'></fieldset></dl></div>

                    <small id='tdE6k'></small><noframes id='tdE6k'>

                    <tfoot id='tdE6k'></tfoot>

                      <tbody id='tdE6k'></tbody>