js模拟腾讯QQ链接文字弹出提示层特效

1周前 (04-25 21:08)阅读12回复0
大陆
大陆
  • 管理员
  • 发消息
  • 注册排名1
  • 经验值4019
  • 级别管理员
  • 主题803
  • 回复2
楼主

用户鼠标点击链接后弹出一个淡黄色提示层,可在提示层内打开新链接或复制网址,在弹出的提示层上面带关闭按钮效果。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta name="keywords" content="武鸣人网站,武鸣信息网,武鸣本地网,武鸣信息资源平台,减肥,健身,励志,励志语录,js特效,网页特效,www.wuming.ren">
<meta name="description" content="欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。">
<title>js模拟腾讯QQ链接文字弹出提示层特效_武鸣人</title>
<script type="text/javascript">
function S(i){return document.getElementById(i)}
function copyUrl(){//复制网址
var clipBoardContent=S("downloadDirect").href;
  try{
    window.clipboardData.setData("Text",clipBoardContent); 
    alert("武鸣人提示您:复制成功!"); 
  }catch(e){
    alert("武鸣人提示您:复制失败!"); 
  }
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
document.onclick = function(evt){//非链接单击时,隐藏对应层
var _target = evt ? evt.target : event.srcElement ;
var _id = _target.id;
if( _id == "" ){
_id = _target.tagName;
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
if( _id !="A"){
S("wwwwumingren").style.display = 'none';
}
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
window.onload=function(){//网页加载时绑定对象
  var wuming_ren=S("wuming_ren");
  var wuming = wuming_ren.getElementsByTagName("a");
  for(var i=0,j=wuming.length; i<j; i++){
    wuming[i].onclick=function(evt){
      var _event = evt ? evt : window.event;
      var _target = evt ? evt.target : window.event.srcElement;
      var _p = S("wwwwumingren");
      _p.style.top = _event.clientY + document.body.scrollTop ;
      _p.style.left = ( _event.clientX + document.body.scrollLeft < 160 ? _event.clientX + document.body.scrollLeft + 10  : _event.clientX  + document.body.scrollLeft - 120 );
      S("wwwwumingren").style.display = '';
      S("downloadDirect").href= this.href;
      return false;
    }
  }
}//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)
</script>
<style type="text/css">
html,body{ font-size:12px;}
a {color:#4d5d2c;text-decoration:underline;cursor:pointer;}
.pointer {cursor:pointer;}
.infobar {background:#fff9e3;border:1px solid #fadc80;color:#743e04;margin-bottom:10px;padding:8px 20px 4px 20px;}
</style>
</head>
<body>
<a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr>
<!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。-->
<script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script>
<script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script>
<div id="wwwwumingren" style="position:absolute;top:0px;left:0px;width:160px;z-index:999;padding:6px 2px 6px 10px;border:1px solid #fb7;display:none;" class="infobar">
<div style="padding:3px 0 0 0;"><a id="downloadDirect" href="javascript:void(0);" target="_blank">打开网址</a>  <a id="downloadAgent" href="javascript:void(0);" onclick="copyUrl()">复制</a>  <a href="javascript:void(0)" onclick="S('wwwwumingren').style.display = 'none';">关闭</a></div>
</div>
点击链接试试看:<br /><br />
<div id="wuming_ren">
  <a href="https://www.wuming.ren">武鸣人</a><br /><br />
</div>
</body>
</html>


0
0
收藏0
回帖

js模拟腾讯QQ链接文字弹出提示层特效 期待您的回复!

取消
载入表情清单……
载入颜色清单……
插入网络图片

取消确定

图片上传中
编辑器信息
提示信息