Book Image

jQuery for Designers Beginner's Guide Second Edition

By : Natalie Maclees
Book Image

jQuery for Designers Beginner's Guide Second Edition

By: Natalie Maclees

Overview of this book

Table of Contents (21 chapters)
jQuery for Designers Beginner's Guide Second Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – customizing PowerTip


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:

  1. 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 the powerTip 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 the eat 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...