最新仿新浪博客右下角弹窗JS代码可关闭可最小化,图片素材自己搞,测试已经通过,就是没有把图片上传,至于那一个是图,自己看,搞JS的这点事难不到,这个代码还是非常好的,通过W3C认证的,其它的,总是出现问题,有用的自己拿。

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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
 
/**-------------右下角弹出窗口--------------------------------------------------------------
*/
cookietime = 72*2;
{
var ua = navigator.userAgent;
var IE = (navigator.appName == "Microsoft Internet Explorer");
var IE5 = IE && (ua.indexOf('MSIE 5') != -1);
var IE5_0 = IE && (ua.indexOf('MSIE 5.0') != -1);
var Gecko = ua.indexOf('Gecko') != -1;
var Safari = ua.indexOf('Safari') != -1;
var Opera = ua.indexOf('Opera') != -1;
var Mac = ua.indexOf('Mac') != -1;
var NS7 = ua.indexOf('Netscape/7') != -1;
var NS71 = ua.indexOf('Netscape/7.1') != -1;
 
if (Opera) {
   IE = true;
   Gecko = false;
   Safari = false;
}
if (IE5) {
         IE = true;
 
         Gecko = false;
         Safari = false;
}
}
function _t(root,tag,id){
var ar=root.getElementsByTagName(tag);
for (var i=0;i<ar.length;i++){
   if (ar[i].id==id) return ar[i];
}
return null;
}
function _(root){
 
var ids=arguments;
var i0=0;
 
if (typeof(root) == 'string') root = document;
else i0=1;
 
for (var i=i0;i<ids.length;i++){
   var s=root.getElementsByTagName("*");
 
   var has=false;
   for (var j=0;j<s.length;j++){
    if (s[j].id==ids[i]){
     root=s[j];
     has=true;
     break;
    }
   }
   if (!has) return null;
}
return root;
}
//util
 
 
function dele(o,fn,rv){
 
var r = function (){
 
   var s=arguments.callee;
 
   var args = [];
   for (var i=0;i<s.length;i++) args[i]=s[i];
   var argStr = args.join(",");
   if (argStr.length > 0) argStr=","+argStr;
 
   var callStr="s.thiz[s.fn]("+argStr+")";
   var v=eval(callStr);
 
 
   if (s.rv!=null) {
    return s.rv;
   } else {
    return v;
   }
}
 
r.thiz=o;
r.fn=fn;
r.rv=rv;
 
return r;
}
 
function ge(e){
if (e!=null) return e;
if (IE) {
   return window.event;
} else return e;
}
 
 
/**
* get event for a element;
*/
function gte(e,ev){
if (!e.getElementById) e=e.ownerDocument;
if (IE) {
   return ev!=null ? ev : e.parentWindow.event;
} else {
   return ev;
   throw new Error("this method can only execute in IE");
}
}
function addEL(n,e,l,b){
 
if (IE){
   if (n["__listener_"+e]==null){
    var lst=function(e){
 
     var f=arguments.callee;
     var ar=f.fList;
 
     e=ge(e);
     for (var i=0;i<ar.length;i++){
      ar[i](e);
     }
    }
    lst.fList=[];
    n["__listener_"+e]=lst;
    n["on"+e]=n["__listener_"+e];
 
 
 
   }
   var fList=n["__listener_"+e].fList;
   fList[fList.length]=l;
 
} else {
   n.addEventListener(e,l,b);
}
}
function cancelEvent(e) {
if (IE) {
   e.returnValue = false;
   e.cancelBubble = true;
} else
   e.preventDefault();
};
function cpAttr(o,p){
for (var i in p){
   var s=p[i];
   o[i]=s;
}
return o;
}
function getValue(v,d){
return v==null ? d : v;
}
var gv=getValue;
 
 
var dom={
parseInt : function(s) {
   if (s == null || s == '' || typeof(s)=='undefined')
    return 0;
 
   return parseInt(s);
},
getClientSize : function(n){
   if (IE){
    //ts("this is ie");
    var s= {x:n.clientLeft,y:n.clientTop};
    s.l=s.x;
    s.t=s.y;
    s.r=n.clientRight;
    s.b=n.clientBottom;
 
    s.w=n.clientWidth;
    s.h=n.clientHeight;
 
    //tr("calculated client size");
 
    return s;
   } else {
    var t=n.style;
    if (t.borderLeftWidth.length==0 || t.borderTopWidth.length==0 || t.borderRightWidth.length==0 || t.borderBottomWidth.length==0){
 
     var l=n.offsetWidth;
     t.borderLeftWidth="0px";
     l-=n.offsetWidth;
 
 
 
     var r=n.offsetWidth;
     t.borderRightWidth="0px";
     r-=n.offsetWidth;
 
     var o=n.offsetHeight;
     t.borderTopWidth="0px";
     o-=n.offsetHeight;
 
     var b=n.offsetHeight;
     t.borderBottomWidth="0px";
     b-=n.offsetHeight;
 
     t.borderLeftWidth=l+"px";
     t.borderTopWidth=o+"px";
     t.borderRightWidth=r+"px";
     t.borderBottomWidth=b+"px";
 
     var s={l:l,r:r,t:o,b:b,x:l,y:o};
 
 
     return s;
    } else {
     var s= {
       x: this.parseInt(n.style.borderLeftWidth),
       y: this.parseInt(n.style.borderTopWidth),
       r: this.parseInt(n.style.borderRightWidth),
       b: this.parseInt(n.style.borderBottomWidth)
      };
     s.l=s.x;
     s.t=s.y;
     return s;
    }
   }
},
 
getSize : function (n,withMargin){
   var c={
    x : n.offsetWidth != null ? n.offsetWidth : 0,
    y : n.offsetHeight != null ? n.offsetHeight : 0
   };
 
   //c.x=this.parseInt(c.x);
   //c.y=this.parseInt(c.y);
 
 
   //tr("get size for : "+n.id);
   //tra(c);
   if (withMargin) {
    var m=this.getMargin(n);
    c.x+=m.l+m.r;
    c.y+=m.t+m.b;
   }
   //tra(m);
   //tr("get size for : "+n.id);
   //tra(c);
   return c;
},
 
setSize : function(elmt,x,y,withMargin){
   //tf("dom::setSize");
   //if (elmt==undefined || elmt.style.display=="none") return;
   if (IE){
    if (withMargin){
     var m=this.getMargin(elmt);
     x-=m.l+m.r;
     y-=m.t+m.b;
    }
    elmt.style.width=x;
    elmt.style.height=y;
   } else {
    var clientSize=this.getClientSize(elmt);
    var dx=clientSize.l+clientSize.r;
 
    var dy=clientSize.t+clientSize.b;
 
    elmt.style.width=x-dx+"px";
    elmt.style.height=y-dy+"px";
   }
},
 
/**
* get the context position relative to its parent.
*/
getPosition : function (elmt,withMargin){
   var c;
 
   c={
    x:elmt.offsetLeft,
    y:elmt.offsetTop
   };
   //c.x=this.parseInt(c.x);
   //c.y=this.parseInt(c.y);
   if (withMargin){
    var m=this.getMargin(elmt);
    c.x-=m.l;
    c.y-=m.t;
   }
 
   return c;
},
setPosition : function (elmt,x,y,withMargin){
 
 
   //tf("dom::setPosition");
   if (withMargin){
    //var m=this.getMargin(elmt);
    //x-=m.l;
    //y-=m.t;
   }
   elmt.style.left=x+"px";
   elmt.style.top=y+"px";
},
 
setAlpha : function (n,a){
   return;
   n.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity="+a*100+");";
   n.style.opacity = a;
   n.style.MozOpacity = a;
}
 
}
var motion={
    smooth : function (s, e, t){
       if (t>1) t=1;
       return (e - s) * t + s;
    },
 
    smooth2: function (b, c, d, t){
       s = -c *(t/=d)*(t-2) + b;
       alert(s);
       return s;
    }
}
 
function PopUp(id, config){
this.id=id;
 
var c = this.config = config;
c.width = gv(c.width,300);
c.height = gv(c.height,200);
c.bottom = gv(c.bottom,0);
c.right = gv(c.right,20);
c.display = gv(c.display,true);
c.contentUrl= gv(c.contentUrl,"");
c.motionFunc= gv(c.motionFunc,motion.smooth);
c.motionFunc2= gv(c.motionFunc2,motion.smooth2);
c.position = {x:0,y:0};
 
var t=c.time;
t.slideIn = gv(t.slideIn,10);
t.hold   = gv(t.hold,10);
t.slideOut = gv(t.slideOut,10);
 
t.slideIn *= 1000;
t.hold   *= 1000;
t.slideOut *= 1000;
 
this.container = document.body;
this.popup = null;
this.content = null;
this.switchButton = null;
 
this.moveTargetPosition = 0;
this.startMoveTime = null;
this.startPosition = null;
 
this.status = PopUp.STOP;
this.intervalHandle = null;
 
this.mm = "max";
 
this.imgMin = "images/small.gif";
this.imgMax = "images/big.gif";
}
 
//static members
PopUp.STOP = 0;
PopUp.MOVE_DOWN = 1;
PopUp.MOVE_UP = 2;
PopUp.SWITCH_TO_MIN = PopUp.MOVE_DOWN | 4;
PopUp.SWITCH_TO_MAX = PopUp.MOVE_UP | 8;
 
 
var __o={
create : function (){
 
   var doc=document;
   var c=this.config;
 
   //create popup holder & config it.
   var p = this.popup = doc.createElement("div");
   this.container.appendChild(p);
 
   p.id=this.id;
   p.style.cssText="position:absolute;\
       z-index:9000;\
       overflow:hidden;\
       border:0px solid #f00;\
       ";
   dom.setSize(p, c.width, c.height);
 
 
 
   //create popup content holder & config it.
   var t = this.content = doc.createElement("div");
   p.appendChild(t);
 
   t.id = this.id+"_content";
   t.style.cssText="position:absolute;\
       z-index:1;\
       overflow:hidden;";
   dom.setSize(t, c.width, c.height);
   dom.setPosition(t,0,0);//add
 
   c.position.y = c.height;//add
   this.onresize();//add
   //dom.setPosition(t, 0, c.height);//hide it at first
 
 
 
   // create content holder's content.
   // a close button & an iframe for loading external content.
   t.innerHTML = "<a id='closeButton' href='#'></a>"+
          "<a id='switchButton' href='#'></a>"+
           "<iframe id='"+this.id+"_content_iframe' src="+c.contentUrl+" frameborder=0 scrolling=no width='100%' height='100%' style='height:100%'></iframe>";
 
 
 
 
   var sBtn = this.switchButton = _t(t,'a',"switchButton");
   sBtn.style.cssText='position:absolute;\
        z-index:2;\
        \
        font-size:0px;\
        line-height:0px;\
        \
        left:240px;\
        top:6px;\
        width:16px;\
        height:15px;\
        \
        background-image:url("images/small.gif");';
 
   addEL(sBtn,"click",dele(this,"switchMode"),true);
   addEL(sBtn,"click",cancelEvent,true);
 
 
   var btn = _t(t,'a',"closeButton");
   btn.style.cssText='position:absolute;\
        z-index:2;\
        \
        font-size:0px;\
        line-height:0px;\
        \
        left:260px;\
        top:6px;\
        width:16px;\
        height:15px;\
        \
        background-image:url("images/close.gif");';
 
 
 
   addEL(btn,"mouseover",function(e){
 
           dom.setAlpha(this,0.4);
           },true);
 
   addEL(btn,"mouseout",function(e){
           dom.setAlpha(this,1);
           },true);
 
 
 
   addEL(btn,"click",dele(this,"hide"),true);
   addEL(btn,"click",cancelEvent,true);
 
   var container=IE ? document.body : document.documentElement;
 
   addEL(document.body,"resize",dele(this,"onresize"),true);
 
    this.__hackTimer=window.setInterval("__popup.onresize()",50);
 
 
 
   addEL(container,"scroll",dele(this,"onresize"),true);
 
   //initialize position at once.
   this.onresize();
 
},
 
show : function (){
 
   if (!this.config.display) return;
 
   this.moveTargetPosition = 0;
   this.status = PopUp.MOVE_UP;
   this.startMove();
},
 
hide : function (){
   this.moveTargetPosition = this.config.height;
   this.status = PopUp.MOVE_DOWN;
   this.startMove();
   writeCookie('pop_close','1',cookietime);
   writeCookie('pop_time', Math.round(new Date().getTime()/1000),cookietime);
   //document.getElementById("xp_content_iframe").parentNode.removeChild(document.getElementById("xp_content_iframe")); change here;
},
 
hideAuto : function (){
   this.moveTargetPosition = this.config.height;
   this.status = PopUp.MOVE_DOWN;
   this.startMove();
   writeCookie('pop_close','1',cookietime);
   //document.getElementById("xp_content_iframe").parentNode.removeChild(document.getElementById("xp_content_iframe")); change here;
},
 
minimize : function (){
   //alert("minimize");
   this.mm = "min";
   this.moveTargetPosition = this.config.height - 28;
   this.status = PopUp.SWITCH_TO_MIN;
   this.startMove();
 
   var s = this.switchButton.style;
 
 
   var bg = s.backgroundImage;
 
   if (bg.indexOf(this.imgMin) > -1) {
    bg = bg.replace(this.imgMin,this.imgMax);
    s.backgroundImage = bg;
   }
 
   writeCookie('pop_close','2',cookietime);
   writeCookie('pop_time', Math.round(new Date().getTime()/1000),cookietime);
},
 
miniAuto : function (){
   //alert("minimize");
   this.mm = "min";
   this.moveTargetPosition = this.config.height - 28;
   this.status = PopUp.SWITCH_TO_MIN;
   this.startMove();
 
   var s = this.switchButton.style;
 
 
   var bg = s.backgroundImage;
 
   if (bg.indexOf(this.imgMin) > -1) {
    bg = bg.replace(this.imgMin,this.imgMax);
    s.backgroundImage = bg;
   }
 
   writeCookie('pop_close','2',cookietime);
},
 
 
 
maximize : function (){
   //alert("maximize");
   if (!this.config.display) return;
 
   this.mm = "max";
   this.moveTargetPosition = 0;
   this.status = PopUp.SWITCH_TO_MAX;
   this.startMove();
 
 
   var s = this.switchButton.style;
   var bg = s.backgroundImage;
 
   if (bg.indexOf(this.imgMax) > -1) {
    bg = bg.replace(this.imgMax,this.imgMin);
    s.backgroundImage = bg;
   }
 
 
   writeCookie('pop_close','3',cookietime);
},
 
delayHide : function (){
 
 
   window.setTimeout("__popup.hideAuto()",this.config.time.hold);
},
 
delayMin : function (){
   window.setTimeout("__popup.miniAuto()",this.config.time.hold);
},
 
switchMode : function (){
   //alert("switch");
   if (this.mm == "min"){
    this.maximize();
   } else {
    this.minimize();
   }
},
 
startMove : function (){
   this.stopMove();
 
   this.intervalHandle = window.setInterval("__popup.move()",5); //变化时间
 
   this.startMoveTime = new Date().getTime();
   //this.startPosition = dom.getPosition(this.content).y;
   //parseInt(this.content.style.top);
   this.startPosition = this.config.position.y;
},
 
stopMove : function (){
   if (this.intervalHandle != null) window.clearInterval(this.intervalHandle);
 
   this.intervalHandle = null;
},
 
 
move : function (){
 
 
   var t = new Date().getTime();
   t = t - this.startMoveTime;
 
   var total = this.status & PopUp.MOVE_UP ?
      this.config.time.slideIn :
      this.config.time.slideOut;
   //alert("s="+this.startPosition+"e"+this.moveTargetPosition+"t="+t+"tr="+t/total);
   var y = this.config.motionFunc(this.startPosition, this.moveTargetPosition, t/total);
   //this.content.style.top = y + "px";
   this.config.position.y = y;
   this.onresize();
 
   if (t >= total){
    this.onFinishMove();
   }
},
 
onFinishMove : function (){
   this.stopMove();
   //this.content.style.top = this.moveTargetPosition + "px";
 
   if (this.status == PopUp.MOVE_UP && this.config.time.hold > 0 ){
 
    this.delayMin();
   } else {
    if (this.__hackTimer!=null) window.clearInterval(this.__hackTimer);
   }
   this.status = PopUp.STOP;
},
 
onresize : function (){
   var c=this.config;
   var t=document.documentElement;
 
   scroll_top = (document.body.scrollTop  >  0) ? document.body.scrollTop : document.documentElement.scrollTop;
   //var t=document.body;
 
   var dx=t.clientWidth + t.scrollLeft;
   var dy=t.clientHeight +  scroll_top;
 
   var x = dx - c.right - c.width ;
   var y = dy - c.bottom - c.height + c.position.y;
 
   //window.alert(y);
 
   dom.setPosition(this.popup, x, y);
   dom.setSize(this.popup, c.width, c.height-c.position.y);
}
}
 
cpAttr(PopUp.prototype,__o);
 
 
/*---------------------------------------*/
 
function readCookie(name)
{
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0)
{
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    {
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = unescape(document.cookie.substring(offset, end))
    }
}
return cookieValue;
}
 
function writeCookie(name, value, hours)
{
var expire = "";
if(hours != null)
{
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire + ";path=/";
}
 
/**
* main function to config the pop-up window & run it.
* web deployer change codes here to manipulte popups performance.
* & should not change codes out of this function.
*/
function job(){
 
/**
* config object
*/
var cfg={
   //width & height of the popup window ,these values should be determined debpended on inner contents.
   width     : 300,
   height     : 200,
 
   //distance to the bottom & the right edge.
   bottom    : 0,
   right    : 19,
 
   //switch of displaying the popup
   display    : true,
 
   //content url
 
 contentUrl     : "http://www.ccshuang51.com/ad.htm",
 
 
 
   //time configuration,in seconds
   time : {
    slideIn    : 1,
    hold     : 60,
    slideOut   : 1
   }
}
 
//at what time the popup should display,in hours : 0~23,
//the number after add symbol means after how many the hours to display popup for the next time.
var displayTimeList = ["7+7"];
 
// the popup displays each time thie page reload or only once at the first time page loaded.
// once / eachTime
//var displayMode = "once";
var displayMode = "eachTime";
 
//cookie name storing the next time to display popup
var cookieName="sina_blog_popup_next_display_time";
 
/**
* --------------------- from here below, the codes should NOT be modified.
*/
var hours={};
var delays=[];
for (var i=0;i<displayTimeList.length;i++) {
   var o = displayTimeList[i];
   var ar = o.split("+");
   var t = parseInt(ar[0]);
   for (var m=0;m<ar.length-1;m++){
      ar[m]=ar[m+1];
   }
   hours[t]=true;
   for (var j=0;j<ar.length;j++){
    hours[t + parseInt(ar[j])]=true;
   }
}
displayTimeList=[];
for (var i in hours){
   var s = parseInt(i);
   if (isNaN(s)) continue;
   displayTimeList[displayTimeList.length]=s;
}
displayTimeList = displayTimeList.sort();
//alert(displayTimeList);
 
 
pp = new PopUp("xp", cfg);
window.__popup=pp;
pp.create();
//display:
 
var n=readCookie(cookieName);
 
if (displayMode=="eachTime"){
   if(readCookie('pop_close') == 1){
       //pp.minimize();
       pp.hideAuto();
   }else if(readCookie('pop_close') == 2){
       pp.miniAuto();
   }else{
       pp.show();
       the_flag = 1;
       the_pp = document.getElementById('xp');
       the_pp.onmouseout = function(event){if(window.event){event = window.event;} if(isMouseLeaveOrEnter(event, this)){ the_flag = 2;} };
       the_pp.onmouseover = function(event){if(window.event){event = window.event;} if(isMouseLeaveOrEnter(event, this)){ the_flag = 2;} };
       setTimeout("if(the_flag==1){pp.miniAuto();}",5000); // change here;
   }
}else {
   var tm=new Date().getTime();
   if (n==null || tm>n) {
    pp.show();
 
    //get next display time
    var hr=new Date().getHours();
    var f = 60*60*1000;
    var l = displayTimeList.concat(), len = l.length;
    for (var i = 0; i < len; i++) l[len + i] = l[i] + 24;
    for (var i = 0; i < l.length && hr >= l[i]; i++);
 
    var dt = new Date();
    dt.setHours(l[i] > 23 ? l[i] - 24 : l[i]);
    var nextTime = dt.getTime();
    if (l[i] > 23) nextTime += f * 24 ;
 
    writeCookie(cookieName, nextTime, 24);
   }
}
 
}
 
 
function doit(){
 
 
    if(document.readyState == 'loaded' || document.readyState == 'complete'){
       job();
    }else{
        window.setTimeout(doit,500);
       return;
    }
 
}
 
doit();
 
window.onscroll = sco;
window.onresize = sco;
function sco()
{
    if(typeof(pp) != 'undefined' )
    {
        pp.onresize();
        /*如果有左浮动窗口*/
        if(typeof(MinScreenW) == "undefined"){}else{
             scall();
        }
    }
}
 
function isMouseLeaveOrEnter(e, handler) {
    if (e.type != 'mouseout' && e.type != 'mouseover') return false;
    var reltg = e.relatedTarget ? e.relatedTarget : e.type == 'mouseout' ? e.toElement : e.fromElement;
    while (reltg && reltg != handler)
        reltg = reltg.parentNode;
    return (reltg != handler);
}

自由转载,转载请注明: 转载自WEB开发笔记 www.chhua.com

本文链接地址: 最新仿新浪博客右下角弹窗JS代码可关闭可最小化 http://www.chhua.com/web-note2663

随机笔记

更多