I am having the Div with scroll bar.When User clicks the scroll bar I need to call the function based on the scroll bar click.How can I make a call?
- I am using Jquery in the client and using the PHP in the server side.
- I know how to make ajax calls and etc.Only think is I need to make this call when scroll bar is clicked in that div.
Is it possible to make the ID for the scroll bar in that div.
You can bind to the
scrollevent, it’s not fired when the user clicks the scroll-bar but it is fired when the scroll-bar moves for any reason:Note that
.on()is new in jQuery 1.7 and in this case is the same as using.bind().To set a flag like I suggest above:
Update
The best solution to adding event handlers to dynamically created elements is to bind to them before adding them to the DOM: