Discuz!官方免费开源建站系统

 找回密码
 立即注册
搜索

高手帮忙,,我的这段代码,需要改一点点,,奖10个币吧

[复制链接]
dz3snet 发表于 2010-1-3 00:48:27 | 显示全部楼层 |阅读模式
这是一个客服在线的代码,,效果如www.dz3s.net    上下能自动调整到位,,但左右不能自动调整。请会的帮忙。。

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

.qqbox{
        width:140px;
        height:auto;
        overflow:hidden;
        position:absolute;
        right:0;
        top:100px;
        color:#0000ff;
        font-size:12px;
        letter-spacing:0px;
}
.qqlv{
        width:25px;
        height:256px;
        overflow:hidden;
        position:relative;
        float:right;
        z-index:50px;
}
.qqkf{
        width:140px;
        height:auto;
        overflow:hidden;
        right:0;
        top:0;
        z-index:99px;
        border:6px solid #138907;
        background:#fff;
}
.qqkfbt{
        width:140px;
        height:20px;
        overflow:hidden;
        background:#138907;
        line-height:20px;
        font-weight:bold;
        color:#fff;
        position:relative;
        border:1px solid #9CD052;
        cursor:pointer;
        text-align:center;
}
.qqkfhm{
        width:140px;
        height:22px;
        overflow:hidden;
        line-height:22px;
        padding-right:8px;
        position:relative;
        margin:3px 0;
}
.bgdh{
        width:140px;
        padding-left:10px;
}
</style>
</head>
<body>
<div class="qqbox" id="divQQbox" style="position: absolute; left: 874px; top: 115px; float:right">
  <div class="qqlv" id="meumid" onmouseover="show()">
        <img

src="images/qq.gif" width="25" height="256"></div>
  <div class="qqkf" style="display:none;" id="contentid" onmouseout="hideMsgBox(event)">
    <div class="qqkfbt" >客 服 中 心</div>
    <div id="K1">
      <div class="qqkfhm bgdh">
                <p align="left"> <a href="tencent://message/?uin=6237711" title="三实数码科

技"><img src="http://wpa.qq.com/pa?p=1:6237711:4" border="0">三实数码科技</a><br/></div>
      <div class="qqkfhm bgdh">
                <p align="left"> <a href="tencent://message/?uin=6237712" title="开心农场"><img

src="http://wpa.qq.com/pa?p=1:6237712:4" border="0">开心农场</a></div>
      <div class="qqkfhm bgdh">
                <p align="left"> <a href="tencent://message/?uin=83510962" title="邓滔"><img

src="http://wpa.qq.com/pa?p=1:6237712:4" border="0">传奇客服</a></div>
      <div class="qqkfhm bgdh">
                <p align="left">手机:15882969658</div>
      <div class="qqkfhm bgdh">
                <p align="left">手机:13388209658</div>
      <div class="qqkfhm bgdh">
                <p align="left">座机:0818-8889715</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.getElementById(c_id+i).style.display='none';
        document.getElementById(h_id+i).className=hout_class;
    }
    document.getElementById(c_id+activeno).style.display='block';
    document.getElementById(h_id+activeno).className=hon_class;
}
var tips;
var theTop = 100;
var old = theTop;
function initFloatTips()
{
        tips = document.getElementById('divQQbox');
        moveTips();
}
function moveTips()
{
                   var tt=50;
                  if (window.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.getElementById("meumid").style.display="none"
        document.getElementById("contentid").style.display="block"
}
        function hideMsgBox(theEvent){
          if (theEvent){
                var browser=navigator.userAgent;
                if (browser.indexOf("Firefox")>0){//Firefox
                    if (document.getElementById("contentid").contains(theEvent.relatedTarget)) {
                                return
                        }
                }
                if (browser.indexOf("MSIE")>0 || browser.indexOf("Presto")>=0){
                if (document.getElementById('contentid').contains(event.toElement)) {
                            return;//结束函式
                    }
                }
          }
          document.getElementById("meumid").style.display = "block";
          document.getElementById("contentid").style.display = "none";
        }
</script></div>
</div>
回复

使用道具 举报

uysun 发表于 2010-1-3 21:37:00 | 显示全部楼层
没明白你的意思?  你是不是把它靠在右边呢?
回复

使用道具 举报

uysun 发表于 2010-1-3 21:42:10 | 显示全部楼层
如果是,那你就改
  1. <div class="qqbox" id="divQQbox" style="position: absolute; left: 874px; top: 115px; float:right">
复制代码
里面的   left: 874px;   把这个改成 right: []px;
回复

使用道具 举报

Vichine 发表于 2010-1-4 00:05:14 | 显示全部楼层
这种简单的实现还需要使用JS??CSS就可以了。。又是一个不追求网站速度的盲目入市者。。。
回复

使用道具 举报

 楼主| dz3snet 发表于 2010-1-5 12:56:45 | 显示全部楼层
回复 3# uysun


    对了,,,非常不错.. 高手就是高手,,  我怎么奖历你呢,
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-10-23 11:02 , Processed in 0.088400 second(s), 14 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表