Hi Yorsal, This for use with the CSS overflow property[1]. For example:
<div class="scroll" style="height: 80px; width: 100px; overflow: scroll;"> <p>Para1</p> <p>Para2</p> <p>Para3</p> <p>Para4</p> <p>Para5</p> </div> And now you listen for scroll events on that div: $('.scroll').each( function() { $(this).scroll(function() { alert("Hello"); }) }); Hope that helps, -John K [1] http://www.w3.org/TR/REC-CSS2/visufx.html#overflow On 2/2/07, 杨乐 <[EMAIL PROTECTED]> wrote: > hello, there is a question about scroll method that following below: > > $("p").scroll( function() { alert("Hello"); } ); > > > <p>Hello</p> > > <p onscroll="alert('hello')">Hello</p> > > but it's not really work when i write code like this: > > $("body").scroll( function() { alert("Hello"); } ); > > do you know why? > -- > yorsal > > _______________________________________________ > jQuery mailing list > discuss@jquery.com > http://jquery.com/discuss/ > -- me: http://www.keyes.ie/johnnyk job: http://www.putplace.com charities: http://www.oxfam.ie | http://www.bothar.org | http://www.ipcc.ie _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/