Js QQ customer service floating effect implementation code

Source: Internet
Author: User

Js QQ customer service floating effect implementation code

Code:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

<! 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>

<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>

<Title> QQ customer service floating special effect code _ www.jb51.net </title>

</Head>

<Body style = "height: 2000px;">

<Script type = "text/javascript">

Window. onload = window. onresize = window. onscroll = function ()

{

Var oBox = document. getElementById ("qqbox_zzjs ");

Var oLine = document. getElementById ("online_lanrenzhijia ");

Var oMenu = document. getElementById ("menu_zzjs_net ");

Var iScrollTop = document.doc umentElement. scrollTop | document. body. scrollTop;

SetTimeout (function ()

{

ClearInterval (oBox. timer );

Var iTop = parseint(document.doc umentElement. clientHeight-oBox. offsetHeight)/2) + iScrollTop;

OBox. timer = setInterval (function ()

{

Var iSpeed = (iTop-oBox. offsetTop)/8;

ISpeed = iSpeed> 0? Math. ceil (iSpeed): Math. floor (iSpeed );

OBox. offsetTop = iTop? ClearInterval (oBox. timer): (oBox. style. top = oBox. offsetTop + iSpeed + "px ");

}, 30)

}, 100)

OBox. onmouseover = function ()

{

This. style. width = 131 + "px ";

OLine. style. display = "block ";

OMenu. style. display = "none ";

};

OBox. onmouseout = function ()

{

This. style. width = '';

OLine. style. display = "none ";

OMenu. style. display = "block ";

};

};

Document. write ("<style> img {border: 0;} ul, li {padding: 0; margin: 0 ;}. box_lanrenzhijia {z-index: 99; right: 0; width: 128px; height: 195px; position: absolute ;}. box_lanrenzhijia. press {right: 0; width: 36px; cursor: pointer; position: absolute; height: 128px ;}. box_lanrenzhijia. zzjs_net_list {left: 0; width: pixel PX; position: absolute; height: 195px; background: url (images/20120321lanrenzhijia_1.gif) no-repeat left center ;}. box_lanr Enzhijia. zzjs_net_list ul {padding: 37px 0 0 21px ;}. box_lanrenzhijia. zzjs_net_list li {height: 26px; margin-bottom: 3px; _ margin-bottom: 3px; list-style-type: none ;} </style> <div class = \ "box_lanrenzhijia \" id = \ "qqbox_zzjs \"> <div class = \ "zzjs_net_list \" id = \ "online_renzhijia \" style = \ "display: none; \ "> <ul> <li> <a href = \" http://wpa.qq.com/msgrd? V = 1 & Uin = 123456789 & Site = script house & Menu = yes \ "> </a> </li> <a href = \ "http://wpa.qq.com/msgrd? V = 1 & Uin = 123456789 & Site = script house & Menu = yes \ "> </a> </li> <a href = \ "http://wpa.qq.com/msgrd? V = 1 & Uin = 123456789 & Site = script house & Menu = yes \ "> </a> </li> <a href = \ "http://wpa.qq.com/msgrd? V = 1 & Uin = 123456789 & Site = script house & Menu = yes \ "> </a> </li> <a href = \ "http://wpa.qq.com/msgrd? V = 1 & Uin = 123456789 & Site = script house & Menu = yes \ "> </a> </li> </ul> </div> <div id = \ "menu_zzjs_net \"> </div> ");

</Script>

</Body>

</Html>

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.