-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwhmozemu.js
67 lines (58 loc) · 1.89 KB
/
whmozemu.js
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
// WebHelp 5.10.002
if (! window.gbIE4 && window.gbNav6 && !document.childNodes[0].insertAdjacentHTML){
HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode)
{
switch (where){
case 'beforeBegin':
this.parentNode.insertBefore(parsedNode,this);
break;
case 'afterBegin':
this.insertBefore(parsedNode,this.firstChild);
break;
case 'beforeEnd':
this.appendChild(parsedNode);
break;
case 'afterEnd':
if (this.nextSibling){
this.parentNode.insertBefore(parsedNode,this.nextSibling);
} else {
this.parentNode.appendChild(parsedNode);
}
break;
}
}
HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){
var r = this.ownerDocument.createRange();
r.setStartBefore(this);
var parsedHTML = r.createContextualFragment(htmlStr);
this.insertAdjacentElement(where,parsedHTML);
}
HTMLElement.prototype.insertAdjacentText = function(where,txtStr){
var parsedText = document.createTextNode(txtStr);
this.insertAdjacentElement(where,parsedText);
}
}
function testScroll() {
// Initialize scrollbar cache if necessary
if (window._pageXOffset==null) {
window._pageXOffset = window.pageXOffset;
window._pageYOffset = window.pageYOffset;
}
// Expose Internet Explorer compatible object model
document.scrollTop = window.pageYOffset;
document.scrollLeft = window.pageXOffset;
window.document.scrollHeight = document.height;
window.document.scrollWidth = document.width;
window.document.clientWidth = window.innerWidth;
window.document.clientHeight = window.innerHeight;
// If cache!=current values, call the onscroll event
if (((window.pageXOffset!=window._pageXOffset) || (window.pageYOffset!=window._pageYOffset)) && (window.onscroll))
window.onscroll();
// Cache new values
window._pageXOffset = window.pageXOffset;
window._pageYOffset = window.pageYOffset;
}
// Create compatibility layer for Netscape
if (window.gbNav6) {
setInterval("testScroll()",50)
}