<script language=javascript>
function show(obj)
{
var str=getIE(obj)
var temp=str.split(",")
var top=temp[0]
var left=temp[1]
var objDiv=document.getElementById("div1")
objDiv.style.display="";
objDiv.style.left=temp[1];
objDiv.style.top=parseInt(temp[0])+parseInt(obj.offsetHeight);
}
function getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
return (t+","+l);
}
function hide(obj){obj.style.display="none"}
</script>
<div id="div1" onMouseOut="hide(this)"style="background-color:red;position:absolute; width:200px; height:100px; top:-100px;"><a href="#">你的问题</a>有问题没</div><a href="javascript:void(0)" onmouseover=show(this)>点我</a>
<br>
<br>
<br>
<br>
<a href="javascript:void(0)" onmouseover=show(this)>点我</a>
<br>简单网上找了一个,css自己修改修改
function show(obj)
{
var str=getIE(obj)
var temp=str.split(",")
var top=temp[0]
var left=temp[1]
var objDiv=document.getElementById("div1")
objDiv.style.display="";
objDiv.style.left=temp[1];
objDiv.style.top=parseInt(temp[0])+parseInt(obj.offsetHeight);
}
function getIE(e){
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop;
l+=e.offsetLeft;
}
return (t+","+l);
}
function hide(obj){obj.style.display="none"}
</script>
<div id="div1" onMouseOut="hide(this)"style="background-color:red;position:absolute; width:200px; height:100px; top:-100px;"><a href="#">你的问题</a>有问题没</div><a href="javascript:void(0)" onmouseover=show(this)>点我</a>
<br>
<br>
<br>
<br>
<a href="javascript:void(0)" onmouseover=show(this)>点我</a>
<br>简单网上找了一个,css自己修改修改
他们二个足矣
<li>
<a href="www.ljiong.com" class="a">设置</a>
<ul>
<a href="www.ljiong.com">www.ljiong.com</a>
</ul>
</li>
</ul>.
//给a标签设置class="a"
$(".a").hover(function(){
$(this).next("ul").slideToggle();
})
.menu{display:none;}
li:hover .menu{display:block}
<a>滑我试试</a>
jQuery(function(){
jQuery("a").hover(function(){
consloe.info("鼠标划过,显示弹框");
jQuery("div").show();
},function(){
console.info("鼠标离开,隐藏弹框");
jQuery("div").hide();
});
});