<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 15:11:41 +0000</lastBuildDate>
    <item>
      <title>(CSS) Cross Browser Background Opacity - chrisdpratt</title>
      <link>https://snipplr.com/view/37237/cross-browser-background-opacity</link>
      <description>&lt;p&gt;This CSS sets semi-transparent background while not affecting the opacity of child elements like using the opacity property would. The text color has been set to the same as the background color to demonstrate this.&#13;
&#13;
Notes:&#13;
&#13;
For the Microsoft filters, color values are in hex with the first two digits specifying the alpha transparency. In this case, that's '80', equivalent to 0.5.&#13;
&#13;
:not(.IE) is added to exclude IE; no current version of IE understands the :not selector. '.IE' can be any valid classname that is NOT used anywhere else.&lt;/p&gt;</description>
      <pubDate>Wed, 14 Jul 2010 03:00:34 UTC</pubDate>
      <guid>https://snipplr.com/view/37237/cross-browser-background-opacity</guid>
    </item>
    <item>
      <title>(PHP) Wordpress MU - Get Info for Current Blog - chrisdpratt</title>
      <link>https://snipplr.com/view/36443/wordpress-mu--get-info-for-current-blog</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 29 Jun 2010 03:39:41 UTC</pubDate>
      <guid>https://snipplr.com/view/36443/wordpress-mu--get-info-for-current-blog</guid>
    </item>
    <item>
      <title>(PHP) Wordpress Debug Config - chrisdpratt</title>
      <link>https://snipplr.com/view/34995/wordpress-debug-config</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 21 May 2010 10:28:09 UTC</pubDate>
      <guid>https://snipplr.com/view/34995/wordpress-debug-config</guid>
    </item>
    <item>
      <title>(HTML) Wordpress Bloginfo Options - chrisdpratt</title>
      <link>https://snipplr.com/view/34022/wordpress-bloginfo-options</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 07 May 2010 09:01:19 UTC</pubDate>
      <guid>https://snipplr.com/view/34022/wordpress-bloginfo-options</guid>
    </item>
    <item>
      <title>(PHP) Get Iteration Count in Wordpress Loop - chrisdpratt</title>
      <link>https://snipplr.com/view/33852/get-iteration-count-in-wordpress-loop</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 04 May 2010 10:11:45 UTC</pubDate>
      <guid>https://snipplr.com/view/33852/get-iteration-count-in-wordpress-loop</guid>
    </item>
    <item>
      <title>(PHP) Include All PHP Files in a Directory - chrisdpratt</title>
      <link>https://snipplr.com/view/33851/include-all-php-files-in-a-directory</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 04 May 2010 10:06:56 UTC</pubDate>
      <guid>https://snipplr.com/view/33851/include-all-php-files-in-a-directory</guid>
    </item>
    <item>
      <title>(JavaScript) Accessible Dropdown Navigation (Handling Focus with jQuery) - chrisdpratt</title>
      <link>https://snipplr.com/view/28092/accessible-dropdown-navigation-handling-focus-with-jquery</link>
      <description>&lt;p&gt;Dropdown navigation is fairly inaccessible as it depends on hover events in 99.9% of cases. Tabbing through the navigation with the keyboard fails to reveal the dropdowns leaving those navigation items virtually inaccessible. Worse, each of the hidden anchors still take focus on tab, so the user is left blind until they've tabbed enough to get to the next top-level navigation item.&#13;
&#13;
The code below selects all the anchor elements in dropdown menus and adds focus and blur events to them. The focus event adds a class of `dropdown-visible` to the top-level list item that contains the dropdown menu in use at the moment (the same li that is used for styling the hover state to show the menu). It also adds a class of `focused` to the anchor that currently has focus. The blur event will need this to handle itself later.&#13;
&#13;
The blur event removes the `focused` class added earlier, and then checks for another anchor in its menu (indirect sibling) that has the `focused` class. If there's no indirect siblings with that class, it's safe to close the dropdown by removing the `dropdown-visible` class. Otherwise, the dropdown is still active and should not be closed (prevents flicker).&#13;
&#13;
With this code, you only need to edit your CSS to add the same styles already being applied to `li:hover` to `li.dropdown-visible`, so that the dropdown looks the same when focused as hovered.&#13;
&#13;
That's it. Pretty straight forward, but adds a heap of accessibility.&#13;
&#13;
Note: The code below assumes the following hierarchy:&#13;
&#13;
*    div#top-nav&#13;
    *    ul&#13;
        *    li&#13;
            *    a&#13;
            *    ul&#13;
                *    li&#13;
                    *    a&#13;
&#13;
Therefore, the selector '#top-nav ul ul a' selects the very last `a` element; adjust the selector as necessary to work with your situation.&lt;/p&gt;</description>
      <pubDate>Wed, 10 Feb 2010 05:20:43 UTC</pubDate>
      <guid>https://snipplr.com/view/28092/accessible-dropdown-navigation-handling-focus-with-jquery</guid>
    </item>
    <item>
      <title>(PHP) Cleanup Wordpress Header - chrisdpratt</title>
      <link>https://snipplr.com/view/27499/cleanup-wordpress-header</link>
      <description>&lt;p&gt;The following is just a list of actions you can remove. Just grab the ones you need.&lt;/p&gt;</description>
      <pubDate>Mon, 01 Feb 2010 13:18:52 UTC</pubDate>
      <guid>https://snipplr.com/view/27499/cleanup-wordpress-header</guid>
    </item>
    <item>
      <title>(PHP) Load jQuery from Google AJAX Libraries API in Wordpress - chrisdpratt</title>
      <link>https://snipplr.com/view/26963/load-jquery-from-google-ajax-libraries-api-in-wordpress</link>
      <description>&lt;p&gt;Place the following code in header.php before the call to wp_head().&#13;
&#13;
(If you do not include the exact version number when calling libraries from Google's AJAX Libraries API, a redirect is used to pull up the most current version. While this is handy, it prevents browsers from caching the script: effectively negating one of the major reasons for using Google's AJAX Libaries API.)&lt;/p&gt;</description>
      <pubDate>Sun, 24 Jan 2010 16:18:17 UTC</pubDate>
      <guid>https://snipplr.com/view/26963/load-jquery-from-google-ajax-libraries-api-in-wordpress</guid>
    </item>
    <item>
      <title>(PHP) Wordpress Templates: Check If Plugin Is Active - chrisdpratt</title>
      <link>https://snipplr.com/view/26937/wordpress-templates-check-if-plugin-is-active</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Sat, 23 Jan 2010 22:36:15 UTC</pubDate>
      <guid>https://snipplr.com/view/26937/wordpress-templates-check-if-plugin-is-active</guid>
    </item>
    <item>
      <title>(PHP) Create a Wordpress 2.8+ Widget - chrisdpratt</title>
      <link>https://snipplr.com/view/26936/create-a-wordpress-28-widget</link>
      <description>&lt;p&gt;Full example widget available at [WP Engineer](http://wpengineer.com/wordpress-built-a-widget/ "Build A WordPress 2.8 Widget With The New Widget API").&lt;/p&gt;</description>
      <pubDate>Sat, 23 Jan 2010 22:26:02 UTC</pubDate>
      <guid>https://snipplr.com/view/26936/create-a-wordpress-28-widget</guid>
    </item>
    <item>
      <title>(JavaScript) Simple JavaScript Audio Player with SoundManager2 - chrisdpratt</title>
      <link>https://snipplr.com/view/20554/simple-javascript-audio-player-with-soundmanager2</link>
      <description>&lt;p&gt;Simple [SoundManager2](http://www.schillmania.com/projects/soundmanager2/doc/download/#latest "Download SoundManager2") example (uses jQuery)&lt;/p&gt;</description>
      <pubDate>Thu, 01 Oct 2009 16:44:22 UTC</pubDate>
      <guid>https://snipplr.com/view/20554/simple-javascript-audio-player-with-soundmanager2</guid>
    </item>
    <item>
      <title>(JavaScript) Detecting Only Actual Text Changes onkeydown/onkeyup/onkeypress in JavaScript - chrisdpratt</title>
      <link>https://snipplr.com/view/19987/detecting-only-actual-text-changes-onkeydownonkeyuponkeypress-in-javascript</link>
      <description>&lt;p&gt;The following script will allow only keys that effect actual text changes in input/textareas (character keys, spacebar, backspace and delete). Any other key type will tell whatever function is handling the event to return and not continue on. As a result, this should be place before the actual processing portion of the function.&lt;/p&gt;</description>
      <pubDate>Mon, 21 Sep 2009 09:38:31 UTC</pubDate>
      <guid>https://snipplr.com/view/19987/detecting-only-actual-text-changes-onkeydownonkeyuponkeypress-in-javascript</guid>
    </item>
    <item>
      <title>(Apache) .htaccess 301 Redirect - chrisdpratt</title>
      <link>https://snipplr.com/view/19813/htaccess-301-redirect</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 16 Sep 2009 10:47:32 UTC</pubDate>
      <guid>https://snipplr.com/view/19813/htaccess-301-redirect</guid>
    </item>
    <item>
      <title>(JavaScript) Sandboxing JavaScript Code So It Doesn't Pollute the Global Namespace - chrisdpratt</title>
      <link>https://snipplr.com/view/19597/sandboxing-javascript-code-so-it-doesnt-pollute-the-global-namespace</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 11 Sep 2009 14:30:56 UTC</pubDate>
      <guid>https://snipplr.com/view/19597/sandboxing-javascript-code-so-it-doesnt-pollute-the-global-namespace</guid>
    </item>
    <item>
      <title>(Regular Expression) RFC 2822-compliant (mostly) Email Address Regular Expression - chrisdpratt</title>
      <link>https://snipplr.com/view/19594/rfc-2822compliant-mostly-email-address-regular-expression</link>
      <description>&lt;p&gt;This regular expression will match almost all valid email addresses. Omits email addresses containing double-quotes and square brackets, which while valid according to [RFC 2822][rfc2822], are almost never used.&#13;
&#13;
[rfc2822]: http://tools.ietf.org/html/rfc2822 "RFC 2822"&lt;/p&gt;</description>
      <pubDate>Fri, 11 Sep 2009 14:20:58 UTC</pubDate>
      <guid>https://snipplr.com/view/19594/rfc-2822compliant-mostly-email-address-regular-expression</guid>
    </item>
    <item>
      <title>(XHTML) Good-looking and Accessible Address Form Fields - chrisdpratt</title>
      <link>https://snipplr.com/view/19572/goodlooking-and-accessible-address-form-fields</link>
      <description>&lt;p&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 11 Sep 2009 12:37:46 UTC</pubDate>
      <guid>https://snipplr.com/view/19572/goodlooking-and-accessible-address-form-fields</guid>
    </item>
    <item>
      <title>(CSS) Cross-Browser Pure CSS Dropdown Navigation - chrisdpratt</title>
      <link>https://snipplr.com/view/19561/crossbrowser-pure-css-dropdown-navigation</link>
      <description>&lt;p&gt;To make the menu work in IE6 (which doesn't support the :hover pseudo element on anything but links and tables), the IE6-specific CSS calls on [Whatever:hover][whatever]. If using [Dean Edwards' IE7-js][IE7-js], this is unnecessary as his script fixes li:hover behavior in IE6.&#13;
&#13;
[whatever]: http://www.xs4all.nl/~peterned/csshover.html "Whatever:hover"&#13;
[IE7-js]: http://code.google.com/p/ie7-js/ "Dean Edwards' IE7-js"&lt;/p&gt;</description>
      <pubDate>Fri, 11 Sep 2009 12:01:58 UTC</pubDate>
      <guid>https://snipplr.com/view/19561/crossbrowser-pure-css-dropdown-navigation</guid>
    </item>
    <item>
      <title>(XHTML) XHTML 1.0 Strict Template Skeleton with jQuery and Dean Edwards' IE7-js - chrisdpratt</title>
      <link>https://snipplr.com/view/19556/xhtml-10-strict-template-skeleton-with-jquery-and-dean-edwards-ie7js</link>
      <description>&lt;p&gt;jQuery is included via the Google AJAX Libraries repository. Dean Edwards' IE7-js is included via it's Google Code hosting URL. Version numbers of both libraries should be checked and updated to latest versions.&#13;
&#13;
_**Note:** While libraries can be referenced from the Google AJAX Libraries repository with abbreviated version numbers (specifying just '1', instead of '1.3.2', for example), it's always better to include the full version number. Otherwise, Google will not sent appropriate cache and expires headers._&lt;/p&gt;</description>
      <pubDate>Fri, 11 Sep 2009 11:38:04 UTC</pubDate>
      <guid>https://snipplr.com/view/19556/xhtml-10-strict-template-skeleton-with-jquery-and-dean-edwards-ie7js</guid>
    </item>
    <item>
      <title>(JavaScript) Google Maps for IE6 and IE7 in XHTML 1.0 Strict - chrisdpratt</title>
      <link>https://snipplr.com/view/19554/google-maps-for-ie6-and-ie7-in-xhtml-10-strict</link>
      <description>&lt;p&gt;XHTML 1.0 Strict deprecates the use of iframes in favor of objects. While this has gotten a lot of flack, iframes were never truly a part of HTML, just a proprietary element in Internet Explorer that eventually got universal support. Objects are a more appropriate way of including external content, but support is limited in IE6 and IE7.&#13;
&#13;
In particular, Google Maps embedded as Objects do not render at all in IE6 or IE7, this JavaScript snippet will take a Google Map embedded as an Object and convert it into an iframe dynamically for IE6 and IE7.&#13;
&#13;
See the URL for more information and usage instructions.&#13;
&#13;
_**Note:** This script works by attaching to an object with an id of "map". If you have multiple maps on one page, or simply want to use a different id, change "map" in the snippet to the id of your choice._&lt;/p&gt;</description>
      <pubDate>Fri, 11 Sep 2009 11:07:06 UTC</pubDate>
      <guid>https://snipplr.com/view/19554/google-maps-for-ie6-and-ie7-in-xhtml-10-strict</guid>
    </item>
    <item>
      <title>(jQuery) jQuery Targets for External Links in XHTML 1.0 Strict - chrisdpratt</title>
      <link>https://snipplr.com/view/19552/jquery-targets-for-external-links-in-xhtml-10-strict</link>
      <description>&lt;p&gt;XHTML 1.0 Strict does not allow the target attribute on links. The recommended way of specifying external links is to give the link a rel attribute of "external". This jQuery snippet finds likes with rel attributes of "external" and dynamically adds a target attribute of "_blank" so they will open in a new tab/window while maintaining valid XHTML 1.0 Strict code.&lt;/p&gt;</description>
      <pubDate>Fri, 11 Sep 2009 10:53:10 UTC</pubDate>
      <guid>https://snipplr.com/view/19552/jquery-targets-for-external-links-in-xhtml-10-strict</guid>
    </item>
  </channel>
</rss>
