这是一个奇怪的问题,我不知道如何去调试这个,所以任何提示和建议表示赞赏。在IE9中jquery事件传播问题
我有一个日历(yui日历),它绝对定位在里面的一切,相对定位。我想要做的是,如果我点击日历之外,它应该关闭,否则不能...
$('html').click(function(e){
console.log("Event reached html level "+$(e.target).attr("class"));
if($(".yui-calcontainer.withtitle").is(":visible"))
{
$(".yui-calcontainer.withtitle").hide();
}
})
$(".yui-calcontainer.withtitle,#calendar_img_1").click(function(e){
console.log("Event reached icon level "+$(e.target).attr("class"));
e.stopPropagation();
});
这工作正常,在FF,甚至IE8,但在IE9,日历内的任何点击,似乎泡沫直到html级别。奇怪的是,它完全忽略了.yui-calcontainer.withtitle
,即使它在页面中,但可以与#calendar_img_1
合作,这基本上是我点击打开日历的图标。
You can see the issue here(点击图标 “选择交货期” 部分在页面的右边)
JavaScript错误可能会阻止事件停止。 – 2013-03-14 05:49:57
@Jack yeh,你可能是对的,但是再次,我没有看到点击和冒泡阶段之间的任何特定错误,它也适用于ie8和FF,所以它是一些特定的东西。 – Bluemagica 2013-03-14 06:01:20