以下代码:单击事件(关闭登录框)不会在 FF 中触发(但是 webkit-browser 工作。而且 slideToggle click 事件在所有浏览器中都有效)。有人知道为什么吗?
非常感谢您的帮助!
HTML
<div class="loginbox" id="loginbox">
<div class="loginbox_close" id="loginbox_close"></div>
...
<input type="button" value="Login" class="btn_login"></div>
</div>
jQuery
$(document).ready(function() {
$('#menu').on('click', '#menu_login', function() {
alert('test'); // this DOES fire, works in all browsers
$('#loginbox').slideToggle(240,'swing');
});
$('#loginbox').on('click', '#loginbox_close', function() {
alert('test'); // does not fire in FF, however webkit browser work!
$('#loginbox').slideUp(240,'swing');
});
});
CSS
.loginbox {
width:164px;
padding:10px 18px 14px 18px;
border:1px solid #CCC;
border-top:0px;
position:absolute;
margin-left:780px;
background:#678;
opacity:0.9;
box-shadow:inset 20px 40px 80px 4px #789,0 2px 8px #ABC;
}
.loginbox_close {
width:20px;
height:20px;
float:right;
background:#EEE;
cursor:pointer;
position:absolute;
margin-left:150px;
}