当鼠标移到超链接上时弹出提示内容且鼠标能复制其中的内容,当鼠标不在超链接和提示内容上时,隐藏提示内容。
拜托各位大侠指点指点,在下不胜感谢!
拜托各位大侠指点指点,在下不胜感谢!
解决方案 »
- prototype 代码问题,求大师帮解
- 梅花雨大师进来看看
- JS把页面中的全部图片汇聚成一条蛇在页面中爬来爬去的问题
- 请教这句话,多谢
- js校验ip地址是否为IPv6格式,是则返回true,否则返回false
- 各位老师,请问如何对一个IP的合法性和身份证号的合法性进行判断?在线等待,谢谢了!
- 为什么这个页面显示的文字有些带"?"号?是不是编码问题啊?
- 怎样把字符串转换成ID?
- 简单的jquery问题请教!
- 求助:JS 的round()方法四舍五入不精正确问题
- 求助ExtJs 两个gridpanel拖动 加入widow窗口之后,报getView().el.dom为空
- java中实现讲js代码传到客户端
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script type="text/javascript">
var p="";
function init(){
var a=document.links;
var div=document.getElementById("test");
for(var i=0;i<a.length;i++){
a[i].onmouseover=over;
a[i].onmouseout=function(){
p=window.setTimeout(out,500);
};
}
div.onmouseover=over;
div.onmouseout=function(){
window.setTimeout(out,500);
};
}
function over(e){
window.clearTimeout(p);
var a=e||window.event;
var src=a.srcElement||a.currentTarget;
var x=parseInt(a.clientX)+4;
var y=parseInt(a.clientY)+4;
var div=document.getElementById("test");
div.style.display="block";
if(src.tagName=="A"){
div.innerHTML=src.getAttribute("href");
div.style.left=x+"px";
div.style.top=y+"px";
}
}
function out(e){
var div=document.getElementById("test");
div.style.display="none";
}
window.onload=init;
</script>
</head><body>
<a href="http://www.baidu.com">baidu</a>
<a href="http://www.hao123.com">hao123</a>
<div id="test" style="display:none;position:absolute; background-color:#0F0"></div>
</body>
</html>
这样试试
<style type="text/css">
.div1
{
display:none;
position:absolute ;
left:50px;
top:50px;
width:100px;
height:100px;
border:1px solid red ;
z-index:0 ;
}.div2
{
z-index:10 ;
border:1px solid blue ;
} </style>
2 jquery代码:$(function(){ $("#input1").mouseover(function(){
$("#div1").addClass("div2");
$("#div1").show();
});$("#div1").mouseout(function(){
$("#div1").hide();
});});3 html:<a id="input1" name="input1" href="#" >连接</a>
<div id="div1" class="div1">
弹出层
</div>