Author Archives: adria

How To Write Google Event Tracking Codes with JQuery

Google event tracking works via some code inside the onclick attribute of links. Rather than putting the code inside every link, you can write a few lines of jQuery and have the codes go into every link on your page.  … Continue reading

Posted in Uncategorized, jQuery | Tagged , | Leave a comment

How To Create Active State Navigation with JQuery

great little article with code samples here: http://www.andrew-turn.net/jquery-for-active-state-navigation jQuery is a clean and fast way to do active state navigation (using a specific class to denote that this link is the current page you are on). I recently updated a … Continue reading

Posted in Uncategorized, jQuery | Tagged , | Leave a comment

How to Create a WordPress Database with MySQL Commands

http://codex.wordpress.org/Installing_WordPress#Detailed_Instructions $ mysql -u adminusername -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5340 to server version: 3.23.54 Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the … Continue reading

Posted in MySQL, linux, wordpress | Tagged , , , | Leave a comment

How To Detect Doctype With Javascript

I had an interesting problem recently where I actually had a need to detect which doctype a page was using, and run some css depending on which HTML version was being used (the publicId property). It took me a long … Continue reading

Posted in Javascript, Uncategorized, ie6, ie7, ie8 | Tagged , , , | Leave a comment

How To SVN Revert to Previous Revision

What do you do when you need to revert back to a previous revision of a file in svn? You can revert to a previous version, or do what is called a “reverse merge.” Here is an explanation of how … Continue reading

Posted in svn | Tagged , , , | Leave a comment

Show Hide Toggle Div Element with Javascript

Showing and hiding, or ‘toggling’ elements is one of the most common tasks in javascript. Here’s a great resource that shows 7 different ways to do this: 7 ways to toggle a div My personal favorite is the ternary operator: … Continue reading

Posted in Javascript, Uncategorized | Tagged , , | Leave a comment

How To Fix Thickbox Position Bug in IE6

Thickbox has a bug in ie6 that makes the box position messed up. Sometimes it will pop up off of the screen, or if you have overflow:scroll enabled in the css, it will make the box really long and it … Continue reading

Posted in ie6, jQuery | Tagged , , | Leave a comment

How To Force IE8 to Render Pages as IE7 Using a Meta-Tag

Possibly the best (although dirty) ie8 browser hack is to avoid ie8 entirely, by using the meta http-equiv tag to force a page to render in the ie version of your choice. It is possible to use a meta tag … Continue reading

Posted in ie7, ie8 | Tagged , , , | Leave a comment

Generating Random Numbers With Math.random() Javascript

The JavaScript function Math.random() randomly generates a number from 0 to slightly less than 1 (shown as

Posted in Javascript, Uncategorized | Tagged , , | Leave a comment

javascript class and className with ie8 and ie7

I often need to access CSS classes to get or set attributes using javascript, and have run into problems with internet explorer support. Here is a way to change the class of an element by ID: [code lang="javascript"] var someId … Continue reading

Posted in Javascript, ie8 | Tagged , , , , | Leave a comment

How to change the background color in Photoshop CS4

It is really easy to change the background color in photoshop cs4: 1. Select the layer (if your background layer is locked, click on it to unlock it) 2. Select the foreground color you want (click on the top square … Continue reading

Posted in Uncategorized, photoshop | Tagged | Leave a comment

How to create a transparent .GIF with white text in Fireworks

I have often noticed when I save my images as transparent GIF files, if they have white text the white turns transparent (which is NOT what I want). A common type of image I use is a rounded green button … Continue reading

Posted in Uncategorized, fireworks | Tagged , , | Leave a comment

How To Get The Selected Value From Select Drop Down Using Javascript

The desired behavior is to access the selected value from the select tag (select drop down list) by creating a javascript function that can be applied with an event handler (most likely onclick).  Here is an example of the markup: … Continue reading

Posted in Javascript, Uncategorized | Tagged , | Leave a comment