From the course: jQuery Mobile Essential Training

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Scroll events

Scroll events - jQuery Mobile Tutorial

From the course: jQuery Mobile Essential Training

Start my 1-month free trial

Scroll events

Okay, now let's take a look at the scrolling events and there's only two of them. There's scrollstop and scrollstart. So here in the snippets code, I've scrolled down to the Scroll Events portion, and I'm going to open up scrollevents_start, and I'm going to copy this script into the document. And we'll put it right above the meta tag here. So, when the page gets created, I'm telling the document that I want to listen for the scrollstop and scrollstart events. And you can see that what I'm essentially doing is console logging out the fact that scrolling stopped or that scrolling started. So we can examine that in the developer tools for the browser. And you can see here that I have a long document. So, this is going to force the scrolling to occur. So, let's save this and let's run it. Now, in Firefox I can also bring up the developer tools. So, let's go ahead and go down to Web Developer right here and I want to take a look at the Web Console, and we can turn off the CSS and the…

Contents