qinHaiXiang
qinHaiXiang

Reputation: 6419

How to trigger an event when I click and scroll the scrollbar of the div container in JQuery~?

E.g:

.container{width:300px; height:300px; overflow:scroll;}

<div class="container">
 with long contents which make the container scroll....
</div>

And I want to trigger events when I click and scroll the scrollbar of container.

Because I have events binded to container.So,I don't want the scrollbar's event is binded to the container itselft.

Thank you very much!!

Upvotes: 0

Views: 2975

Answers (1)

Cory House
Cory House

Reputation: 15045

You can bind multiple events via jQuery like this:

$('.container').bind('click scroll', function() {      
    alert('scroll or click occurred')
});

Upvotes: 1

Related Questions