Let's take a look at some of the options we have to customize PowerTip and how we can use them. We'll keep working with the files we set up in the preceding example:
Let's say that we want to change the position of the tooltip. PowerTip gives us plenty of options to position tooltips on our page, as follows:
How do we tell PowerTip where we want our tooltips to appear? Let's go back to that line of code in our
scripts.js
file where we called thepowerTip
method to create the custom tooltips:$('.gallery img').powerTip();
Remember in Chapter 1, Designer, Meet jQuery, we talked about how we can pass things to methods and functions by putting them inside the parentheses? We had the example
dog.eat('bacon');
, where we wanted to say that the dog was eating bacon. So, in JavaScript, we passed bacon to theeat
method of the dog.Well, in this case, we can pass a set of options to the
powerTip
method to define where our tooltips are placed, among other things. To...