onScroll

スクロールされた時に発生します。Windows版/Mac版Internet Explorer 5以降、Firefox、Safari、Operaで利用することができます。

構文

<タグ名 onScroll="イベント発生時の処理">
オブジェクト.onscroll = "イベント発生時の処理"

例文

<html>
 <head>
  <title>onScroll</title>
</head>
 <body>
  <script type="text/javascript"><!--
  window.onload = function() {
   document.getElementById("sArea").onscroll = function() {
    document.getElementById("result").innerHTML = "Scroll Event !!";
   }
  }
  // --></script>
 <div id="result"></div>
 <div id="sArea" style="width:100px;height:100px;overflow:scroll;background-color:orange;font-size:24pt;">
 onScroll<br>Event<br>Sample<br>
 </div>
 </body>
</html>

関連記事

スポンサーリンク

WgetがSSLでダウンロードできない場合

ホームページ製作・web系アプリ系の製作案件募集中です。

上に戻る