我有一些元素,在调度 mouseenter 时,它会创建一个 div,该 div 使用只有边框的 div 覆盖所选元素。
像这样的东西:
function attachSelectorBarTo(el){
var bar = $('#editor-selection-bar');
bar.css({
top:el.offset().top,
left:el.offset().left
width:el.outerWidth(),
height:el.outerHeight()
}).show();
}
$(function(){
$('[editordata]').mouseenter(function(event){
event.stopPropagation();
attachSelectorBarTo($(this));
}).mouseleave(function(){
//hideSelectorBar();
});
});
但是,选择器 div 处于绝对位置,并且 z-index 比其他的大。所以,当我尝试选择另一个元素时,下面的元素当然不会得到 mouseneter 事件。我的问题是:有一种方法可以让选择器 div 不阻止其他元素事件吗?