Article introduction of Wulin.com (www.vevb.com): In the QQ chat window, when a friend sends us a URL link, when moving the mouse to the link, a prompt box will appear, prompting us to open, copy or report. In fact, we can also achieve this effect on the web page. Today, I will teach you how to achieve the prompt effect of clicking on the link in the QQ chat window.
In the QQ chat window, when a friend sends us a URL link, when moving the mouse over the link, a prompt box will appear, prompting us to open, copy or report. In fact, we can also achieve this effect on the web page. Today, I will teach you how to achieve the prompt effect of clicking on the link in the QQ chat window.
The off code is as follows:
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN >
<html xmlns=>
<head>
<meta http-equiv=Content-Type content=text/html; charset=gb2312 />
<title>How to click on the link in the imitation QQ chat window to show prompt effect - Aspku.com</title>
<script language=JavaScript type=text/javascript>
function S(i){return document.getElementById(i)}
function copyUrl(){ //Copy URL
var clipBoardContent=S(downloadDirect).href;
try{
window.clipboardData.setData(Text,clipBoardContent);
alert (This URL has been copied to the clipboard.);
}catch(e){
alert (The copy is unsuccessful, please copy it in IE browser.);
}
}
document.onclick = function(evt){ //Hide the displayed layer when clicking in a location that is not a link
var _target = evt ? evt.target : event.srcElement ;
var _id = _target.id;
if( _id == ){
_id = _target.tagName;
}
if( _id !=A){
S(downloadPanel).style.display = 'none';
}
}
window.onload=function(){ //When web page is loaded, all a under the specified object are bound to be bound.
var html=S(htmer);
var html1 = html.getElementsByTagName(a);
for(var i=0,j=htmer1.length; i<j; i++){
html1[i].onclick=function(evt){
var _event = evt ? evt : window.event;
var _target = evt ? evt.target : window.event.srcElement;
var _p = S(downloadPanel);
_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(downloadPanel).style.display = '';
S(downloadDirect).href= this.href;
return false;
}
}
}
</script>
<style type=text/css>
html,body{ font-size:12px;}
a {color:#0000FF;text-decoration:underline;cursor:pointer;}
.pointer {cursor:pointer;}
.infobar {background:#EAF9FF;border:1px solid #1D5CBB;color:#0000FF;margin-bottom:10px;padding:8px 20px 4px 20px;}
</style>
</head>
<body>
<div id=downloadPanel style=position:absolute;top:0px;left:0px;width:160px;z-index:999;padding:6px 2px 6px 10px;border:1px solid #1D5CBB;display:none; class=infobar>
<div style=padding:3px 0 0 0;><a id=downloadDirect href=javascript:void(0); target=_blank>Open URL</a> <a id=downloadAgent href=javascript:void(0); onClick=copyUrl()>Copy</a> <a href=javascript:void(0) onClick=S('downloadPanel').style.display = 'none';>Close</a></div>
</div>
<div id=htmer>
<p><a href=></a></p>
<p><a href=></a></p>
</div>
</body>
</html>