-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwindow.js
40 lines (34 loc) · 1.05 KB
/
window.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
///////////////////////////////////////////////////////
/// These functions where taken from SELFHTML reference
/// http://de.selfhtml.org/javascript/beispiele/fensterueberwachen.htm
/// It reloads page after resizing browser window
///////////////////////////////////////////////////////
function Fensterweite () {
if (window.innerWidth) {
return window.innerWidth;
} else if (document.body && document.body.offsetWidth) {
return document.body.offsetWidth;
} else {
return 0;
}
}
function Fensterhoehe () {
if (window.innerHeight) {
return window.innerHeight;
} else if (document.body && document.body.offsetHeight) {
return document.body.offsetHeight;
} else {
return 0;
}
}
function neuAufbau () {
if (Weite != Fensterweite() || Hoehe != Fensterhoehe())
location.href = location.href;
}
/* Überwachung von Netscape initialisieren */
if (!window.Weite && window.innerWidth) {
window.onresize = neuAufbau;
Weite = Fensterweite();
Hoehe = Fensterhoehe();
}
///////////////////////////////////////////////////////