慕先生4543078
2017-07-21 09:52:45
<div?class="outside">
????<div?class="inside"></div>
</div>*?{
??margin:?0px;
??padding:?0px;
}
.outside?{
??width:?200px;
??height:?200px;
??border:?1px?solid?black;
??margin:?0px?auto;
??position:?relative;
}
.outside?.inside?{
??width:?100%;
??height:?100%;
??background:?green;
??position:?absolute;
??top:?0px;
??left:?0px;
}$(function(){
????$(".outside").mouseover(function(event)?{
????????$(".inside").animate({
????????????"height":?"0px",
????????????"top":?"100%"
????????},?function(){
????????????$(".inside").stop(true,?true);
????????});
????});
????$(".outside").mouseout(function(event)?{
????????$(".inside").animate({
????????????"height":?"100%",
????????????"top":?"0px"
????????},?function(){
????????????$(".inside").stop(true,?true);
????????});
????});
})如果焦點在.outside元素上亂劃,.inside元素會保持mouseover()事件中的狀態。這是為什么?
添加回答
舉報
0/150
提交
取消