Effects made easy

What the UI plugin does is add in a single new function called .effect() that offers, 15 or so, new and slick animation effects. Most notably, blind, which rolls things up like a blind; shake, which adds a little shake; and explode, which manages to "break" the object up and shoots pieces of it out in several directions.

Let's apply the shake effect to headers in our posts when we mouse-over them. In addition to registering and/or including the necessary jQuery and jQuery UI plugin files in our WordPress project, you should have also included a custom-jquery.js file to your theme to work with. Once you've done that, include the following code:


jQuery(".post h2").hover(function(){ jQuery(this).effect('shake', 2 0 0); }, function(){

You can (sort of) see this effect in action in the following screenshot:

MNUt enim ad minim veniam

Lorem ipsum dolor sit amet, consectetur adipis icing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud

Was this article helpful?

0 0
Blogging For Business

Blogging For Business

Download this Guide And Discover How Start And Run Your Very Own Successful Business Blog. Always Wanted To Start Your Own Blog?

Get My Free Ebook

Post a comment