English 中文(简体)
Chrome诉FFhton, 点击行为
原标题:Chrome vs. FF button click behavior

I used the :active pseudoclass on my buttons to change the padding and border color when clicked. This visually mimics a button press. See an example.

FF。 但在 Chrome,点击总没有登记。 具体来说,如果你点击了纽芬兰文内的案文,然后拖走案文(但仍在纽伦河内),那么点击不会起火。 如果你在婚礼中点击,那么就拖入案文。

I ve read weird things about buttons and padding in FF vs. Chrome but I can t figure out how to solve this problem.

最佳回答

Solution: Give it a Single Thing to Click

添加<条码>:相对至<条码>>,然后用<条码>将其转发<>。 诸如:

button:before {
    content:   ;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

Seemed to resolve the bug for me. See this fiddle. I imagine it resolves the bug (which I do think it is a bug) by giving a single "element" to focus upon when it is clicked.

问题回答

在与你一起玩.之后,我认为我听到了幕后发生的事情。 通过缺席点击事件,将检查降火和停用活动,然后才能发射击退。 问题是,你在案文上点击,目前的目标就是案文(这意味着在案文区域内已发生停用事件,并且正在等待发射模拟事件以完成点击事件)。 然而,你在案文外 d倒,在案文区外放大 mo,而你目前的具体目标是布顿,而不是案文(在文字区,但在纽顿区,烟火发生),所以点击事件已经失败。 然而,如果你点击案文和拖拉,并释放案文区内的 mo,那将只会奏效。 这是事件的泡沫或捕获问题。 在 j里,我们有活动、活动或活动。

我建议的是利用 mo降和 mo化活动,而不是点击事件。

使用“烟雾”而不是“烟雾”,它应当在电、ome和ff中工作。

 var elementName = "";

    $("button").mouseup(function() {

        if (elementName != "" && elementName == "BUTTON") {


            $("#clicks").append("<span>click</span><br/>");
            elementName = "";
        }

    });


    $("button").mousedown(function() {

        elementName = $(this).get(0).tagName;

    });




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签