Projet

Général

Profil

Paste
Télécharger (738 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / adaptivetheme / at_core / scripts / window-size.js @ 74f6bef0

1
(function () {
2
  var f = document,
3
    a = window,
4
    b = f.createElement("div"),
5
    c = "window-size-indicator",
6
    e = function () {
7
      if (a.innerWidth === undefined) {
8
        b.innerText = f.documentElement.clientWidth + "x" + f.documentElement.clientHeight;
9
      } else if (f.all) {
10
        b.innerText = a.innerWidth + "x" + a.innerHeight;
11
      } else {
12
        b.textContent = window.innerWidth + "x" + window.innerHeight;
13
      }
14
    };
15
  f.body.appendChild(b);
16
  b.setAttribute("class", c);
17
  e();
18
  if (a.addEventListener) {
19
    a.addEventListener("resize", e, false);
20
  } else {
21
    if (a.attachEvent) {
22
      a.attachEvent("onresize", e);
23
    } else {
24
      a.onresize = e;
25
    }
26
  }
27
})();