ウィンドウのサイズを取得する

現在開いているウィンドウの表示領域のサイズを取得するには以下のメソッドを使用します。

  var width = Sabel.Window.getWidth();
  var height = Sabel.Window.getHeight();
  alert("縦:" + height + "px, 横:" + width + "pxです");

表示領域だけでなく、スクロール領域を含むサイズを取得することもできます。

  var width = Sabel.Window.getScrollWidth();
  var height = Sabel.Window.getScrollHeight();
  alert("縦:" + height + "px, 横:" + width + "pxです");

現在のスクロール位置を取得するには以下のメソッドを使用します。

  var top = Sabel.Window.getScrollTop();
  var left = Sabel.Window.getScrollLeft();
  alert("縦に" + top + "px, 横に" + left + "pxスクロールしています");

<< 戻る