Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title>Example</title>
    <style>P { margin-bottom: 40%; }</style>
  </head>
  <body>
    <p>Paragraph 1</p>
    <p>Paragraph 2</p>
    <p>Paragraph 3</p><p>Paragraph 1</p>
    <p>Paragraph 2</p>
    <p>Paragraph 3</p><p>Paragraph 1</p>
    <p>Paragraph 2</p>
    <p>Paragraph 3</p>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script>
      $(function(){
$('p').each(function (i) {
    $(this).css('border', '2px solid');
});
    $(window).scroll(function (event) {
        console.log('scroll triggered, but nothing happens!');
        $('p',event.target).css('border', '10px solid'); // FAILS with TypeError: event.target.css is not a function
    });
        });
    </script>
  </body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers