div에 마우스를 올렸을 때 다른 div로 덮어주고 싶은데..
깜빡이는 현상이 나오네요..
..
자식 요소로 추가해서 하면 깜빡이지는 않지만 다른 div로의 이동이 불가능하면서 버튼에 click 이벤트 를 걸어준게 잘 먹히질 않네요(ie)..
저와 같은 문제를 해결하신 분 안계신가요? ^^;
<!DOCTYPE html>
<html>
<head>
< language="java" src="../js/jquery-1.11.0.min.js"></>
<style>
.sample { padding:10px; width:100%; background:#EEE; border:1px solid red;}
#control { position:absolute; display:none; border:3px solid yellow; background:blue;}
</style>
</head>
<body>
<div class="sample">
sample01
<div class="sample">
sample02
</div>
</div>
<div id="load">
<div id="control">
<input type="button" id="btn1" value="btn1" />
<input type="button" id="btn2" value="btn2" />
<input type="button" id="btn3" value="btn3" />
</div>
</div>
</body>
</html>
<스크립트>
$(".sample").on('mouseover mouseleave', function (event) {
event.stopPropagation();
if(event.type == "mouseover"){
//$("#control").appendTo($(this)); //이렇게 해당 div에 넣어주면 깜빡이지는 않네요..
var objl = $(this).offset().left;
var objt = $(this).offset().top;
var objw = $(this).outerWidth();
var objh = $(this).outerHeight();
$("#control")
.css({
"width":objw,
"height":objh,
"left":objl,
"top":objt
})
.show();
}else{
$("#control")
//.appendTo($("#load"))
.hide();
}
});
$("#control").on("#btn1","click",function(){
alert("btn1 clicks");
});
$("#btn2").click(function(){
alert("btn2 click");
});
$("#btn3").click(function(){
alert("btn3 click");
});
</스크립트>