<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 悬停问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                Ordinals in words javascript(javascript中的序数)

                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>