教程集 www.jiaochengji.com
教程集 >  脚本编程  >  javascript  >  正文 js固定在网页右侧可显隐网站客服代码

js固定在网页右侧可显隐网站客服代码

发布时间:2017-04-30   编辑:jiaochengji.com
教程集为您提供js固定在网页右侧可显隐网站客服代码等资源,欢迎您收藏本站,我们将为您提供最新的js固定在网页右侧可显隐网站客服代码资源
js固定在网页右侧可显隐网站客服代码
提示:您可以先修改部分代码再运行

<textarea name="runcool" rows="28" cols="75" > <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <meta http-equiv="content-type" content="text/html;charset=gb2312"> <style type="text/css"> body,a{font-size:12px;color:#000000;} a{text-decoration:none;color:#000000;} ul{margin-left:10px;} li{list-style:none;} .qqbox{z-index:99;width:178px;right:0;top:145px;position:absolute;} .qqbox .press{right:0;border:none;cursor:pointer;width:33px;height:158px;position:absolute;} .qqbox .qlist{left:0;width:145px;background:url(/blog/upload/image/20100705071136.gif) repeat-y -155px 0;position:absolute;} .qqbox .qlist .t, .qqbox .qlist .b{float:right;height:6px;width:145px;font-size:1px;} .qqbox .qlist .t{background:url(/blog/upload/image/20100705071136.gif) no-repeat left;} .qqbox .qlist .b{background:url(/blog/upload/image/20100705071136.gif) no-repeat right;} .qqbox .qlist .con{background:#fff;width:90%;margin:0 auto;} .qqbox .qlist .con h2{height:22px;font:bold 12px/22px "宋体";background:url(/blog/upload/image/20100705071136.gif) repeat-y -163px 0;border:1px solid #3a708d;text-align:center;color:#fff;} .qqbox .qlist .con ul{} .qqbox .qlist .con ul li{ padding:5px 0 0 8px;height:20px;background:#ffffff;} .qqbox .qlist .con ul li .odd{background:#fff;} </style> </head> <body>
<h2>在线客服</h2> <ul> <li class="odd">qq咨询qq咨询1</li> <li>qq咨询qq咨询2</li> <li>欢迎您</li> <li>tel:010-88888888</li> </ul>
qq客服热线
<script language="javascript" type="text/javascript"> // initfloattips(); function onlineover(){ document.getelementbyid("divmenu").style.display = "none"; document.getelementbyid("divonline").style.display = "block"; document.getelementbyid("divqqbox").style.width = "145px"; } function onlineout(){ document.getelementbyid("divmenu").style.display = "block"; document.getelementbyid("divonline").style.display = "none"; } if(typeof(htmlelement)!="undefined") //给firefox定义contains()方法,ie下不起作用 { htmlelement.prototype.contains=function(obj) { while(obj!=null&&typeof(obj.tagname)!="undefind"){ //通过循环对比来判断是不是obj的父元素     if(obj==this) return true;     obj=obj.parentnode;   } return false; }; } function hidemsgbox(theevent){ //theevent用来传入事件,firefox的方式   if (theevent){   var browser=navigator.useragent; //取得浏览器属性   if (browser.indexof("firefox")>0){ //如果是firefox    if (document.getelementbyid("divonline").contains(theevent.relatedtarget)) { //如果是子元素    return; //结束函式 } } if (browser.indexof("msie")>0){ //如果是ie if (document.getelementbyid("divonline").contains(event.toelement)) { //如果是子元素 return; //结束函式 } } } /*要执行的操作*/ document.getelementbyid("divmenu").style.display = "block"; document.getelementbyid("divonline").style.display = "none"; } </script> </body> </html></textarea>
提示:您可以先修改部分代码再运行

您可能感兴趣的文章:
js固定在网页右侧可显隐网站客服代码
javascript 固定在网页右侧的可显隐网站QQ客服
网页右侧的可显隐网站QQ客服代码
jQuery右侧导航插件 Flexible Nav
Jquery实现侧边栏跟随滚动条固定(兼容IE6)
jquery实现漂浮在网页右侧的qq在线客服插件示例
javascript 悬浮在页面左侧的可显隐网摘收藏效果
网页中返回顶部代码(多种方法)另附注释说明
基于jquery的跟随屏幕滚动代码
怎么样提升你的流量

[关闭]
~ ~