【发布时间】:2012-09-06 10:34:08
【问题描述】:
我有一个包含多个具有绝对位置的 div 的 div,我想为父 div 处理鼠标输入事件,我使用这个小提琴: fiddle 它不能正常工作是他们处理这个问题的任何其他方式吗?
HTML 标记
<div id="content">
SYDNEY (Reuters) - An Australian man had his driving licence suspended for 10 months and was fined after he was
<div class="abs"></div>
caught driving a scooter made of a motorised beer cooler capable of carrying several dozen drinks -- after knocking back a few.
</div>
<div id="output">
</div>
脚本
$(function() {
var output = $("#output");
$("#content")
.mouseenter(function(e){
output.text("I'm in!");
}).mouseout(function(e) {
output.text("I'm out!");
});
});
#content {
background-color:#cccc99;
position:relative;
}
.abs{
position:absolute;
top:0px;
left:70px;
background-color:red;
width:30px;
height:30px;
}
【问题讨论】:
-
正常,哪里有问题??
-
我已经编辑了小提琴
-
我认为在这种情况下应该关闭问题? :-)
标签: css jquery mouseenter jquery-hover