WP-Mix

A fresh mix of code snippets and tutorials

Category Archive: JavaScript

Posts about JavaScript

Page 4 of 5

Tabbed sidebar menu with jQuery

Here’s an clean, simple way to add a tabbed sidebar menu using jQuery. You can see an example in the Introspection WP Theme.

Add Tweet-this with jQuery

Quick jQuery snippet today for adding a “Tweet this” button for all of your site’s pages. You can see a demo here at WP-Mix (lower-right corner).

Google Translate in 2 Steps

Follow this simple two-step tutorial to enable users to translate your web pages into many different languages. Great way to increase exposure and traffic.

Include external, current version of jQuery

Quick tip for including (linking to) the current version of jQuery from external sources.

jQuery switch styles

Switching CSS styles on click (or other event) is easily accomplished with jQuery. Here are two examples showing how to use jQuery to switch styles.

jQuery browser detection

Here’s a tasty little snippet for adding custom browser classes using jQuery.

Simple jQuery tooltip

There are many great jQuery plugins for creating tooltips, but for simple cases only a few lines of code are needed.

Simple live comment preview with jQuery

Here is a very simple and basic live-preview for comments and contact forms.

Live comment preview with JavaScript

Here is a simple way to display a live comment preview for any comment or contact form using ordinary JavaScript.

Display local time with JavaScript

Another oldie but goodie, here is a chunk of JavaScript code that will display local time in a variety of formats.

Random colors with JavaScript

Here is an old script that’s just too precious to throw away, so here it is for the sake of reference and utter amusement.

Spamless email links with PHP and jQuery

Couple of quick snippets for you today.. here’s how to display spamless email links on your web pages using either PHP or jQuery.