我有以下css:
.glb-nav-hamburger {
display: block;
position: absolute;
left: 25px;
z-index: 1000;
top: 38px;
cursor: pointer;
}
.glb-nav-hamburger span, .glb-nav-hamburger span:before, .glb-nav-hamburger span:after {
cursor: pointer;
border-radius: 1px;
height: 5px;
width: 35px;
background: white;
position: absolute;
display: block;
content: '';
}
.glb-nav-hamburger span:before {
top: -10px;
}
.glb-nav-hamburger span:after {
bottom: -10px;
}
.glb-nav-hamburger span, .glb-nav-hamburger span:before, .glb-nav-hamburger span:after {
transition: all 500ms ease-in-out;
}
以及以下html
<button class="glb-nav-hamburger"><span></span></button>
我有一个带有以下事件的骨干视图
"click .glb-nav-hamburger": "showMenu",
在所有其他浏览器中,我可以单击按钮的任何部分并运行showMenu函数;但是,在firefox中我只能点击按钮的一小部分来运行showMenu函数。如果单击按钮的中心,则showMenu函数不会运行。如果我单击按钮的左侧部分,showMenu函数就会运行。
如何在firefox中点击按钮的任何部分并运行showMenu函数?
答案 0 :(得分:1)
尝试将绝对定位的按钮设置为高度和高度。宽度:
.glb-nav-hamburger {
display: block;
position: absolute;
left: 25px;
z-index: 1000;
top: 38px;
cursor: pointer;
width: 35px;
height: 35px; /* not sure if this would be the height needed for your button */
}