Image rollovers in WordPress posts?
Not the most obvious thing to have in blog posts, but rollovers can be nice to have on static pages – especially if you use WordPress to build full web sites.
Download: JRoll WordPress plugin
Installation: just unzip jroll.zip in your plugins folder.
Usage: For a given image file, e.g. “image.jpg”, the corresponding rollover image file must be named “image_o.jpg”.
Then you add class=”ro” in your image code, like:
<img src="image.jpg" class="ro" />
<input type="image" src="image.jpg" class="ro" />
- For some reason, WP seems to delete the
classtags, so I had to edit the posts directly in the database.
- You must use a recent version of jquery. The one that ships with WordPress (currently 1.1.4) does not work. I had to replace it with version 1.2.3. That is, I downloaded jquery from jquery.com/ and replaced /var/www/html/wordpress-mu-1.3.3/wp-includes/js/jquery/jquery.js with the downloaded jquery script.