QQ右飘窗

mac2022-06-30  25

<style type="text/css"> .qqbox a:link {color: #000;text-decoration: none; } .qqbox a:visited {color: #000;text-decoration: none; } .qqbox a:hover {color: #f80000;text-decoration: underline; } .qqbox a:active {color: #f80000;text-decoration: underline; } .qqbox a:active {color: #f80000;text-decoration: underline; } .qqbox a:active {color: #f80000;text-decoration: underline; }

.qqbox{width:182px;height:auto;overflow:hidden;position:absolute;right:0;top:180px;color:#000000;font-size:12px;letter-spacing:0px; } .qqlv{width:25px;height:256px;overflow:hidden;position:relative;float:right;z-index:50px; } .qqkf{width:170px;height:auto;overflow:hidden;right:0;top:0;z-index:99px;border:4px solid #0078ab;background:#f3faff; } .qqkfbt{width:170px;height:30px;overflow:hidden;background:#f3faff;line-height:30px;font-weight:bold;color:#2962a4;position:relative;border-top:1px solid #4ba9e6;cursor:pointer;text-align:center;background:url(/images/bb.gif) repeat-x; } .qqkfhm{width:170px;height:22px;overflow:hidden;line-height:22px;padding-right:0px;position:relative;margin:0px 0;background:#f3faff;text-align:center;color:#044aa2;

} .bgdh{width:152px;color:#044aa2; }

</style> <div id="divQQbox" class="qqbox"> <div id="meumid" class="qqlv" οnmοuseοver="show()"><img alt="" src="http://images.cnblogs.com/online.gif" /></div> <div style="display: none" id="contentid" class="qqkf" οnmοuseοut="hideMsgBox(event);">

<div id="qq-1" class="qqkfbt" οnfοcus="this.blur();" onClick="showandhide('qq-','qqkfbt','qqkfbt','K',3,1);">株洲/湘潭/衡阳/永州/益阳</div> <div id="K1"> <div class="qqkfhm bgdh"><a href="tencent://message/?uin=692906389"><img border="0" alt="" src="http://wpa.qq.com/pa?p=1:692906389:4" />沈雨春</a></div> <div class="qqkfhm bgdh">手机:13755118033</div> </div>

<div id="qq-2" class="qqkfbt" οnfοcus="this.blur();" onClick="showandhide('qq-','qqkfbt','qqkfbt','K',3,2);">吉首/岳阳/张家界/娄底/邵阳</div> <div style="display: none" id="K2"> <div class="qqkfhm bgdh"><a href="tencent://message/?uin=692903028"><img border="0" alt="" src="http://wpa.qq.com/pa?p=1:692903028:4" />侯波</a></div> <div class="qqkfhm bgdh">手机:13187317609</div> </div>

<div id="qq-3" class="qqkfbt" οnfοcus="this.blur();" onClick="showandhide('qq-','qqkfbt','qqkfbt','K',3,3);">常德/浏阳/怀化/郴州</div> <div style="display: none" id="K3"> <div class="qqkfhm bgdh"><a href="tencent://message/?uin=692903099"><img border="0" alt="" src="http://wpa.qq.com/pa?p=1:692903099:4" />林华</a></div> <div class="qqkfhm bgdh">手机:13607445886</div> </div> </div> </div> <script language="javascript"> function showandhide(h_id,hon_class,hout_class,c_id,totalnumber,activeno) { var h_id,hon_id,hout_id,c_id,totalnumber,activeno; for (var i=1;i<=totalnumber;i++) { document.getElementByIdx_x(c_id+i).style.display='none'; document.getElementByIdx_x(h_id+i).className=hout_class; } document.getElementByIdx_x(c_id+activeno).style.display='block'; document.getElementByIdx_x(h_id+activeno).className=hon_class; } var tips; var theTop = 180; var old = theTop; function initFloatTips() {tips = document.getElementByIdx_x('divQQbox');moveTips(); } function moveTips() {  var tt=50; if (windows.innerHeight) {pos = window.pageYOffset }else if (document.documentElement && document.documentElement.scrollTop) {pos = document.documentElement.scrollTop }else if (document.body) { pos = document.body.scrollTop; } //http: pos=pos-tips.offsetTop+theTop; pos=tips.offsetTop+pos/10; if (pos < theTop){ pos = theTop; } if (pos != old) { tips.style.top = pos+"px"; tt=10;//alert(tips.style.top); } old = pos; setTimeout(moveTips,tt); } initFloatTips();if(typeof(HTMLElement)!="undefined")//给firefox定义contains()方法,ie下不起作用{ HTMLElement.prototype.contains=function (obj) { while(obj!=null&&typeof(obj.tagName)!="undefind"){//    if(obj==this) return true;     obj=obj.parentNode;    } return false; }} function show() {document.getElementByIdx_x("meumid").style.display="none"document.getElementByIdx_x("contentid").style.display="block" }

function hideMsgBox(theEvent){ //theEvent用来传入事件,Firefox的方式

  if (theEvent){

  var browser=navigator.userAgent; //取得浏览器属性

  if (browser.indexOf("Firefox")>0){ //如果是Firefox

   if (document.getElementByIdx_x('contentid').contains(theEvent.relatedTarget)) { //如果是子元素

   return; //结束函式 }

}

if (browser.indexOf("MSIE")>0){ //如果是IE

if (document.getElementByIdx_x('contentid').contains(event.toElement)) { //如果是子元素

return; //结束函式

}

}

}

document.getElementByIdx_x("meumid").style.display = "block"; document.getElementByIdx_x("contentid").style.display = "none"; } </script>

转载于:https://www.cnblogs.com/475089730/archive/2012/11/14/2769865.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)