The Google +1 Sprite Animation

How the +1 Button Works

Google +1 Button The +1 Button uses an advanced sprite technique to simulate an animated `gif`. The animation occurs when hovering over search results with +1 enabled, and the shine moves across the button. (The image to the right is an animated `gif` I made…)

The +1 Button is not an animated `gif`, however. It’s a sprite image that moves a background image across the “window” of the button using Javascript. The code, if you care, goes something like this:


The sprite image Google uses for the +1 button is below:

Google +1 Sprite

Pretty neat, huh?

Yeah, the +1 Button animation is pretty neat…
…now turn it off!

Oh goodness gracious, the animation is annoying. After hovering over one search result, it’s obvious how awful the animation is and I want to claw my eyes out with a rusty nail. I wanted to find a way to disable the animation. Continue reading “The Google +1 Sprite Animation”

Passing parameters from PHP to Javascripts in plugins » Otto on WordPress

Much cleaner. One static and unchanging JS file to cache. Parameters get put into your HTML itself as a one-liner. You can deal with the parameters using a normal PHP array before passing them over. No need to screw around with generating Javascript from PHP or looking for wp-load or even messing with tricky actions.

via Passing parameters from PHP to Javascripts in plugins » Otto on WordPress.

jQuery validator annoyances

Null or Not an Object my ASS!

For all of you that use jQuery and use the Validator plugin, you may have been getting this error in Internet Explorer 6:

jQuery.Validator is null or not an object

This code will break any jQuery below your validation code, and will thoroughly piss you off.

The fix is simple: use the minified version (jquery.validate.min.js) javascript file, instead of the packed version (jquery.validate.pack.js).

Simple Vertical Align Plugin for jQuery

Everything in it's right place.
Sometimes you may want to vertically align a block item, but the CSS-only vertical aligning methods don’t make you feel clean.  Personally, I hate having to style items as a table/table cell to get them to vertically align in Internet Explorer.

jQuery to the rescue.  Using a jQuery vertical align snippet as my base code, I modified it to be a jQuery plugin that will allow you to use the function in the jQuery chain. Continue reading “Simple Vertical Align Plugin for jQuery”

Disable Styles and Javascript in Safari with Keyboard Shortcuts – How To

Now Safari’s just as cool as Firefox

If you’re a web developer on the Mac, you may be sick of everyone talking about Firefox Addons that do everything but wipe your ass. True, Firefox is a great browser that is very expandable, but I love Safari, and I want to do as much web development on Safari as possible.

The feature that I missed the most in Safari was Disable Styles and Disable Javascript, both of which are super-easily done in Firefox via the Web Developer Plugin. With the advent of Safari 3, disabling CSS and Javascript is as simple as a keystroke combination of your choice! Continue reading “Disable Styles and Javascript in Safari with Keyboard Shortcuts – How To”