QQ customer service for websites with javascript fixed on the right of the webpage

Source: Internet
Author: User
Tip: you can modify some code before running

<!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><title>Customer service of a website that is fixed on the right of the webpage</title><meta http-equiv="content-type" content="text/html;charset=gb2312"><!--把下面代码加到<head>与</head>之间--><style type="text/css">Body, a {font-size: 12px; color: #000000 ;}a {text-decoration: none; color: #000000 ;}ul {margin-left: 5px ;} li {list-style: none ;}. qqbox {z-index: 99; width: 170px; right: 3px; top: 145px; position: absolute ;}. qqbox. press {right: 0; border: none; cursor: pointer; width: 26px; height: 136px; position: absolute ;}. qqbox. qlist {left: 0; width: 170px; background: url (http://www.111cn.net/effect/images/201007040830/siderim_bg.gif) padding: 5px ;}. qqbox. qlist. B {float: right; height: 6px; width: 170px; font-size: 1px ;}. qqbox. qlist. infobox {text-align: center; background: # bdc5cb; background-image: url (http://www.111cn.net/effect/images/201007040830/siderim_infobox.gif); background-repeat: no-repeat; padding: 5px; line-height: 14px; color: #000; font-weight: 700 ;}. qqbox. qlist. t {background: url (http://www.111cn.net/effect/images/201007040830/siderim_title.gif); height: 34px ;}. qqbox. qlist. B {background: url (http://www.111cn.net/effect/images/201007040830/siderim_bottom.gif); height: 9px; overflow: hidden ;}. qqbox. qlist. con {background: url (http://www.111cn.net/effect/images/201007040830/siderim_bg.gif); width: 100%; padding: 10px 0px 10px 0px ;}. qqbox. qlist. con h2 {height: 22px; font: bold 12px/22px ""; background: url (http://www.111cn.net/effect/images/201007040830/siderim_bg.gif) repeat-y-163px 0; border: 1px solid # 3a708d; text-align: center; color: # fff ;}. qqbox. qlist. con ul li {padding: 5px 5px 0px 15px ;}</style></head><body><div ></div><!--把下面代码加到<body>与</body>之间--><div class="qqbox" id="divqqbox"><div class="qlist" id="divonline" onmouseout="hidemsgbox(event);" ><div class="t"></div><div class="infobox">Our business hours<br>AM-AM</div><div class="con"><ul><li>Qq consultation</li><li>Msn consultation</li><li>Wangwang online</li><li>Tel: 010-88888888</li></ul></div><div class="b"></div></div><div id="divmenu" onmouseover="onlineover();"></div></div><script language="javascript" type="text/javascript">//<![cdata[var tips; var thetop = 145/*这是默认高度,越大越往下*/;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;}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 (); 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") // defines the contains () method for firefox. {htmlelement. prototype. contains = function (obj) {while (obj! = Null & typeof (obj. tagname )! = "Undefind") {// determine whether it is the parent element of obj through cyclic comparison if (obj = this) return true; obj = obj. parentnode;} return false ;};} function hidemsgbox (theevent) {// theevent is used to input events. In firefox, if (theevent) {var browser = navigator. useragent; // Get the browser property if (browser. indexof ("firefox")> 0) {// if it is firefox if (document. getelementbyid ("divonline "). contains (theevent. relatedtarget) {// if it is a sub-element return; // end function} if (browser. indexof ("msie")> 0) {// if it is ieif (document. getelementbyid ("divonline "). contains (event. toelement) {// if the sub-element is return; // end function }}/ * action to be executed */document. getelementbyid ("divmenu "). style. display = "block"; document. getelementbyid ("divonline "). style. display = "none ";}</script></body></html>
Tip: you can modify some code before running
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.