Time for action – adding up and down arrows

Let's add top and bottom buttons to our scrollbars so our scrollbars look and behave more like native scrollbars.

  1. Let's go back to that line of code in our scripts.js file where we called the jScrollPane() method to create the custom scrollbars:
    $('#scrolling').jScrollPane();

    Remember how we could pass things to methods and functions by putting them inside the parentheses? We had the following example:

    dog.eat('bacon');

    where we wanted to say that the dog was eating bacon. So, in JavaScript-speak we passed bacon to the eat method of the dog.

    Well, in this case, we can pass a set of options to the jScrollPane method to control how our scrollbars look and act. We want to show the top and bottom arrows on our ...

Get jQuery for Designers Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.