这段代码为做广告的朋友可以提供大量的收入,而且浏览者也不怎么反感.
点击以后 24小时内再次浏览将不会出现,精确判断使用者.
本代码只为学习之用,请大家使用时注意节制,用多了会被 广告商K的,有什么不明白可以留言
1
var ggdj = function (p_id)
2
{
3
this.id = p_id; var newDiv;
4
this.test = function ()
5
{
6
newDiv = document.getElementById(this.id)
7
if(newDiv == null) {alert("请传入正确的ID!");return ;}
8
if(getCookie()) return;
9
newDiv = newDiv.cloneNode(true);
10
for(var nI = 0; nI<newDiv.childNodes.length; nI++)
11
if(newDiv.childNodes[nI].nodeName.toLowerCase() == "a")
12
newDiv.childNodes[nI].style.cursor = "default";
13
newDiv.id="newDiv"; newDiv.style.filter = "Alpha(opacity=10)";
14
newDiv.style.position ="absolute";
15
newDiv.style.cursor ="default";
16
document.body.appendChild(newDiv);
17
newDiv.onclick = function (){
18
writeCookie();
19
document.body.removeChild(newDiv);
20
}
21
document.onmousemove = function () {
22
newDiv.style.top = event.y - newDiv.clientHeight/2;
23
newDiv.style.left = event.x - newDiv.clientWidth/2;
24
}
25
}
26
var writeCookie = function()
27
{
28
var time = new Date();
29
time.setTime(time.getTime() + 86400000);
30
document.cookie = "8KD6SF6679OH6SFEJ7IU9I9E6=96FIY8GHIJIGG; expires="+time.toGMTString();
31
}
32
var getCookie = function()
33
{
34
if(document.cookie.indexOf("8KD6SF6679OH6SFEJ7IU9I9E6") != -1)
35
return true;return false;
36
}
37
}
38
39
/*
40
使用说明:
41
如下调用就行了,注意new ggdj("这里是你要显示的那个广告DIV的ID")
42
43
//--------------------------
44
<SCRIPT LANGUAGE="JavaScript" type="text/javascript"
45
src="test.js"></SCRIPT>
46
<SCRIPT LANGUAGE="JavaScript">
47
<!--
48
new ggdj("adsfas").test();//adsfas 就是要复制DIV的id
49
//-->
50
</SCRIPT>
51
//===========================
52
*/

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

43

44

45

46

47

48

49

50

51

52
