jQuery日本語リファレンス

jQuery does not mean Japanese Query...

Events/API/jQuery - Sample Code

scroll(fn)


            
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="/jquery/js/jquery.js"></script>
  
  <script>
  $(document).ready(function(){
    
    $("p").clone().appendTo(document.body);
    $("p").clone().appendTo(document.body);
    $("p").clone().appendTo(document.body);
    $(window).scroll(function () { 
      $("span").css("display", "inline").fadeOut("slow"); 
    });

  });
  </script>
  <style>
  div { color:blue; }
  p { color:green; }
  span { color:red; display:none; }
  </style>
</head>
<body>
  <div>Try scrolling the iframe.</div>

  <p>Paragraph - <span>Scroll happened!</span></p>
</body>
</html>
            
          
[実行結果]
[scroll(fn) の説明へ]