メインコンテンツまでスキップ

ポータル画面の表示領域を取得

現在表示しているポータル画面の表示領域を取得します。

構文

atPocket.portal.getContentSpaceElement();

引数

なし

戻り値

ポータルの表示領域を表す DOM要素オブジェクト を返します。
取得した要素を操作することで、表示領域にカスタムコンポーネントを動的に配置できます。

使用可能画面

  • ポータル画面

使用例

// Headerのカスタム領域を取得
const contentSpace = atPocket.portal.getContentSpaceElement();

// カスタムメッセージ要素を作成
const customMessage = document.createElement('div');
customMessage.textContent = 'カスタムメッセージを表示中...';
customMessage.style.padding = '10px';
customMessage.style.backgroundColor = '#f0f0f0';
customMessage.style.border = '1px solid #ddd';
customMessage.style.textAlign = 'center';

// Headerの領域にメッセージを追加
contentSpace.appendChild(customMessage);

結果画面

ポータル上部