<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="atom.xsl"?>
	<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.splintered.co.uk,2005:/experiments/</id>
	<lat xmlns="http://www.w3.org/2003/01/geo/wgs84_pos#">53.506786</lat> 
	<long xmlns="http://www.w3.org/2003/01/geo/wgs84_pos#">-2.314479</long>
	<title>splintered - random sparks of creative insight - experiments</title>
	<subtitle>the portfolio and experimental playground of patrick h. lauke aka redux</subtitle>
	<rights>Copyright Patrick H. Lauke, all rights reserved</rights>
	<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/"/>
	<link rel="self" type="application/atom+xml" href="http://www.splintered.co.uk/feeds/experiments.xml"/>
	<updated>2008-03-15T19:56:13+00:00</updated>
	<author>
		<name>Patrick H. Lauke</name>
	</author>

	<entry>
		<title>firefox 3 zoom toolbar extension</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/97"/>
		<id>tag:www.splintered.co.uk,2008-03-12:/experiments/97</id>
		<published>2007-12-01T00:00:00+00:00</published><updated>2008-03-12T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2008-03-12T19:22:10 --><p>a simple firefox extension that lets you add buttons for firefox 3's built-in zoom functionality to the toolbar, for easier user access. this is a redevelopment of my <a href="http://www.splintered.co.uk/experiments/70/">firefox text size toolbar</a> - sadly, text resizing itself has been removed from version 3 altogether...</p><p>the magnifying glass icon is part of <a href="http://jonas.seph.ws/">jonas rask</a>'s <cite>danish royalty free icons</cite> set.</p><p>tags: firefox extension</p></div>
		</content></entry>
	<entry>
		<title>last.fm recent tracks</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/98"/>
		<id>tag:www.splintered.co.uk,2008-02-12:/experiments/98</id>
		<published>2008-02-12T00:00:00+00:00</published><updated>2008-02-12T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2008-03-15T15:45:17 --><p>out of boredom, yet another experiment using uses my <a href="http://www.splintered.co.uk/experiments/69/"><acronym title="PHP Hypertext Processor">PHP</acronym> feedreader class</a>, running the <a href="http://ws.audioscrobbler.com/1.0/user/patrick_h_lauke/recenttracks.xml">audioscrobbler <cite>recent tracks</cite> feed</a> of <a href="http://www.last.fm/user/patrick_h_lauke/">my last.fm account</a> through a <a href="http://www.splintered.co.uk/experiments/archives/last.fm/lastfm.xsl">custom <abbr title="eXtensible Stylesheet Language Transformation">XSLT</abbr></a> to output the last 10 tracks played.</p><p>tags: lastfm experiment xml xslt</p></div>
		</content></entry>
	<entry>
		<title>firefox Geo extension</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/71"/>
		<id>tag:www.splintered.co.uk,2007-10-12:/experiments/71</id>
		<published>2005-03-06T00:00:00+00:00</published><updated>2007-10-12T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2007-10-12T11:35:43 --><p><q><a href="http://geourl.org">GeoURL</a> is, in brief, a geographical coordinates to <acronym title="Uniform Resource Locator">URL</acronym> reverse directory.</q></p><p>this extension adds a new button to the browser's status bar. if a document features either an <var>ICBM</var> or <var>geo.position</var> <code class="inline">META</code> element, this extension allows to open geo-related sites (such as Google Maps) and pass on the document's coordinates.</p><p><strong>update:</strong> version 0.7 adds direct support for Google Maps, Yahoo! Maps, Microsoft Live Local, Multimap, Flickr, Wikimapia, OpenStreetMap, GeoURL. behind the scenes, the extension code has been completely rewritten in preparation of version 1.0, which will allow users to add / modify / delete their own preferred geo-related services (as long as they use a URI-based REST API).</p><p>tags: firefox geo</p></div>
		</content></entry>
	<entry>
		<title>forcing RSS Bandit into passive FTP mode</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/96"/>
		<id>tag:www.splintered.co.uk,2007-09-17:/experiments/96</id>
		<published>2007-09-17T00:00:00+00:00</published><updated>2007-09-17T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2007-09-17T03:25:55 --><p><a href="http://www.rssbandit.org">RSS Bandit</a> offers built-in functionality to store its feed list remotely (though it still insists on a proprietary format, instead of using/extending standard <a href="http://www.opml.org/"><abbr title="Outline Processor Markup Language">OPML</abbr></a>). i not only use this option to keep my reading habits synchronised between various desktops, but also to provide the raw behind-the-scenes data for this site's <a href="http://www.splintered.co.uk/externals/">externals</a> list.</p><p>unfortunately, RSS Bandit's <abbr title="File Transfer Protocol">FTP</abbr> settings don't provide an explicit option to force the program into passive <abbr title="File Transfer Protocol">FTP</abbr> mode, opting instead for autodetection. this works...most of the time, but can cause major problems with certain routers - such as my little linksys WAG54GX2 - which pretend to support active <abbr title="File Transfer Protocol">FTP</abbr> but attempt to do address translation (of things like PORT commands) on the fly.</p><p>while i certainly hope that a future version of the bandit will include a simple checkbox that just says <q>Use passive FTP</q>, the current hackish way to force a passive connection is to close the application, open your settings file (usually <code class="inline">C:\Documents and Settings\[YOUR USERNAME]\Application Data\RssBandit\.settings.xml</code>), find the line</p><pre>
<code>&lt;property name=&quot;remotefeedlist/ftp.connectionmode.passive&quot;&gt;False&lt;/property&gt;
</code></pre><p>and manually change it to</p><pre>
<code>&lt;property name=&quot;remotefeedlist/ftp.connectionmode.passive&quot;&gt;True&lt;/property&gt;
</code></pre><p>tags: rssbandit xml</p></div>
		</content></entry>
	<entry>
		<title>youtube</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/93"/>
		<id>tag:www.splintered.co.uk,2007-07-21:/experiments/93</id>
		<published>2007-07-21T00:00:00+00:00</published><updated>2007-07-21T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2007-07-21T22:47:34 --><p>an experiment that uses my <a href="http://www.splintered.co.uk/experiments/69/"><acronym title="PHP Hypertext Processor">PHP</acronym> feedreader class</a> to fetch the latest 10 items from my <a href="http://uk.youtube.com/profile?user=reduxphl">youtube account</a> via the simple <a href="http://uk.youtube.com/dev_docs">youtube developer</a> <abbr title="Representational State Transfer">REST</abbr> <abbr title="Application Programming Interface">API</abbr> functions and present them using a custom <abbr title="eXtensible Stylesheet Language Transformation">XSLT</abbr>.</p><p>tags: youtube video experiment API XML XSLT</p></div>
		</content></entry>
	<entry>
		<title>yahoo! upcoming events</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/94"/>
		<id>tag:www.splintered.co.uk,2007-07-21:/experiments/94</id>
		<published>2007-07-21T00:00:00+00:00</published><updated>2007-07-21T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2007-07-21T22:47:02 --><p>an experiment that uses my <a href="http://www.splintered.co.uk/experiments/69/"><acronym title="PHP Hypertext Processor">PHP</acronym> feedreader class</a> to fetch all events, past and future, currently in my <a href="http://upcoming.yahoo.com/user/111908/">upcoming events list</a> via the <a href="http://upcoming.yahoo.com/services/api/">upcoming developer <abbr title="Application Programming Interface">API</abbr></a> functions, and present them using a custom <abbr title="eXtensible Stylesheet Language Transformation">XSLT</abbr>.</p><p>also includes (slightly inelegant) code to quickly hack around upcoming's <a href="http://upcoming.yahoo.com/services/api/token_auth.php">token-based authentication</a>.</p><p>tags: upcoming experiment API XML XSLT</p></div>
		</content></entry>
	<entry>
		<title>rename.pl, ActivePerl and windows</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/92"/>
		<id>tag:www.splintered.co.uk,2007-07-08:/experiments/92</id>
		<published>2007-07-07T00:00:00+00:00</published><updated>2007-07-08T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2007-07-08T01:50:49 --><p>not a full experiment, but something of note for those like me starting with perl on windows...</p><p>i recently needed to get a simple method for batch-renaming a large number of files, with a flexible way of controlling the new filenames. after a bit of searching, i came across larry wall's <cite>rename.pl</cite> script:</p><pre>
<code>$op = shift or die &quot;Usage: rename expr [files]\n&quot;;
chomp(@ARGV = ) unless @ARGV;
for ( @ARGV ) 
{
  $was = $_;
  eval $op;
  die $@ if $@;
  rename ( $was, $_ ) unless $was eq $_;
}

</code></pre><p>the script allows for the use of regular expressions, or any other bits of perl code, to create filename replacements.</p><p>unfortunately, despite a fresh install of <a href="http://www.activestate.com/Products/activeperl/">ActivePerl</a>, this code didn't seem to do anything. after some lengthy searching, it turns out that windows' <cite>command.com</cite> doesn't support wildcard expansion, leaving it up to scripts to handle it instead. if you plan on doing a lot of perl scripting on windows, there's a permanent workaround for this in the <a href="http://aspn.activestate.com/ASPN/docs/ActivePerl-5.6/lib/Pod/perlwin32.html"><cite>Perl under Win32</cite></a> documentation ... but for a quick fix, the script needs to be modified to emulate the wildcard expansion as follows:</p><pre>
<code><strong>use File::DosGlob;</strong>
<strong>@ARGV = map {</strong>
<strong>  my @g = File::DosGlob::glob($_) if /[*?]/;</strong>
<strong>  @g ? @g : $_;</strong>
<strong>} @ARGV;</strong>

$op = shift or die &quot;Usage: rename expr [files]\n&quot;;
chomp(@ARGV = ) unless @ARGV;
for ( @ARGV ) 
{
  $was = $_;
  eval $op;
  die $@ if $@;
  rename ( $was, $_ ) unless $was eq $_;
}

</code></pre><p>i'm a bit surprised that ActiePerl didn't cater for this already in its vanilla install, but no matter ... from the command line, it's now possible to do simple, yet powerful things like</p><pre>
<code>rename.pl &quot;tr/A-Z/a-z/&quot; *

</code></pre><p>to change all filenames in the current directory to lowercase. in my particular case, i had a huge number of images from my recent visit to prague, all with <code class="inline">IMG_XXXX.jpg</code> filenames. using</p><pre>
<code>rename.pl &quot;s/IMG_/prague-june2007_/&quot; *.jpg

</code></pre><p>i could simply replace the <code class="inline">IMG_ part</code>, resulting in files with a far more useful filename of <code class="inline">prague-june2007_XXXX.jpg</code>.</p><p>oh, one final note on windows-specific quirks of the command line: always use double quotes for your arguments, as single quotes get passed as literal characters to the script.</p><p>tags: perl windows</p></div>
		</content></entry>
	<entry>
		<title>laptop connections at PQ07</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/95"/>
		<id>tag:www.splintered.co.uk,2007-06-18:/experiments/95</id>
		<published>2007-06-18T00:00:00+00:00</published><updated>2007-06-18T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 2.0.0.0 on 2007-07-28T18:50:22 --><blockquote><p>The OISTAT Sound Working Group is pleased to announce the Laptop Connections Installation, to take place at the Masarykovo Railway Station during <a href="http://www.pq.cz/"><abbr title="Prague Quadriennale">PQ</abbr>07</a>. The installation/performance will include eight to ten pairs of sound designers, one member of each team onsite and the other member in a remote location, performing a live soundscore in the Railway Station. Each onsite designers will be strategically positioned around the station with their laptops, connected to a WiFi network, amplified through a pair of powered computer speakers and perform their contribution into the unique environment that is the Masarykovo Station.</p><p>The time for the event is 1700-1900 hours on Monday June 18th</p><p>The performance content is to be developed by each team, using the idea of &quot;Bridging Cultures&quot; as a jumping off point. The content could be streamed from the remote location to the Masarykovo Station to the partner onsite, where it is broadcast. Or it could be first manipulated or augmented by the onsite designer. Or it could be manipulated and folded back to the first designer for broadcast in their location. Or none of those things. Or all of those things. The possibilities are open and will only be limited by technology.</p><p>[...]</p><p>Team 4 - Karen Hay (UK) and Kris Popat (UK) Patrick Lauke / Prague and Leeds / Investigation of language, place and space involving verbal information passed between groups of live participants in both locations.</p></blockquote><p>this experiment is a small extract of the audio (MP3) we produced in team 4, mixed together by <a href="http://www.soundvalley.co.uk/">karen hay</a>. technically, this experiment involved the use of <a href="http://www.puredata.org">puredata</a> and <a href="http://www.cycling74.com/">max/msp</a>, with a live connection between masarykovo nádraží and leeds via <a href="http://www.ninjam.com/">ninjam</a> (via <a href="http://www.asio4all.com/">ASIO4ALL</a> and <a href="http://www.ntonyx.com/vac.htm">virtual audio cable</a> for the two WinXP laptops on location at the trainstation).</p><p>photographs from the event are available in my <a href="http://www.flickr.com/photos/redux/sets/72157600568967661/"><cite>laptop connections project at PQ07</cite> flickr set</a>.</p><p>tags: pq pq07 pq2007 prague quadriennale project experiment audio laptop puredata max/msp ninjam</p></div>
		</content></entry>
	<entry>
		<title>dreamweaver additional tags extension</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/88"/>
		<id>tag:www.splintered.co.uk,2006-12-30:/experiments/88</id>
		<published>2006-12-30T00:00:00+00:00</published><updated>2006-12-30T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><p>as I frequently need access to a few <abbr title="(eXtensible) HyperText Markup Language">(X)HTML</abbr> elements not readily available in Dreamweaver's default toolbar/menu, I quickly threw together this simple extension.</p>
<p>the current version includes:</p>
<ul>
<li><code class="inline">code</code></li>
<li>inline quote (<code class="inline">q</code>)</li>
<li><code class="inline">address</code></li>
<li>citation source (<code class="inline">cite</code>)</li>
<li>insertion (<code class="inline">ins</code>)</li>
<li>deletion (<code class="inline">del</code>)</li>
<li>defining instance (<code class="inline">dfn</code>)</li>
<li>heading 4/5/6 (<code class="inline">h4</code>/<code class="inline">h5</code>/<code class="inline">h6</code>)</li>
</ul>
<p>once installed, these objects can be accessed from the "Additional Tags" category of the Insert Bar or from the "Insert &gt; HTML &gt; Additional Tags" menu.</p><p>tags: dreamweaver extension html</p></div>
		</content></entry>
	<entry>
		<title>web essentials 05 - molly holzschlag keynote SMIL</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/79"/>
		<id>tag:www.splintered.co.uk,2006-07-25:/experiments/79</id>
		<published>2005-11-20T00:00:00+00:00</published><updated>2006-07-25T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 1.7.1.0 on 2006-12-10T00:16:21 --><p>following on from last year's short <a href="http://www.splintered.co.uk/experiments/66/">web essentials 04 - zeldman keynote captioned with quicktime SMIL</a>, this year I created a <a href="http://www.w3.org/AudioVideo/"><acronym title="Synchronised Multimedia Integration Language">SMIL</acronym></a> version of <a href="http://molly.com">Molly Holzschlag</a>'s one hour keynote address &quot;The State of the Web 2005&quot; for <a href="http://we05.com">web essentials 05</a>, featuring the original audio/podcast synchronised with the presentation slides and captions.</p><p>you can choose the <a href="http://webstandardsgroup.org/audio/mp3/we05-1-molly-holzschlag/we05-1-molly-holzschlag2.qtl">online version</a> or download the <a href="http://webstandardsgroup.org/audio/mp3/we05-1-molly-holzschlag-SMIL.zip">zipped version</a> to play locally.</p><p>on some systems it can happen that the online version loses its synchronisation when jumping to and from different parts in the timeline...something to do with quicktime's caching. if you let the keynote run its course undisturbed, the sync should be maintained. failing that the offline/download version, combined with a local copy of the original podcast audio file, should work fine.</p><p>thanks go to <a href="http://www.logohere.co.uk/">andy saxton</a> and <a href="http://www.blether.com">dan champion</a> for their invaluable help with the transcript (by far the most tedious part of the process)...cheers fellas!</p><p>tags: SMIL molly video presentation</p></div>
		</content></entry>
	<entry>
		<title>amazon wishlist</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/85"/>
		<id>tag:www.splintered.co.uk,2006-06-26:/experiments/85</id>
		<published>2006-06-26T00:00:00+00:00</published><updated>2006-06-26T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 1.7.0.0 on 2006-06-26T01:12:55 --><p>an experiment that uses my <a href="http://www.splintered.co.uk/experiments/69/"><acronym title="PHP Hypertext Processor">PHP</acronym> feedreader class</a> to fetch the latest 10 items from <a href="http://www.amazon.co.uk/gp/registry/3G6SU2STNMA82">my wishlist</a> via the <a href="http://aws.amazon.com/">amazon web services</a> <abbr title="Representational State Transfer">REST</abbr> <abbr title="Application Programming Interface">API</abbr> functions and present them using a custom <abbr title="eXtensible Stylesheet Language Transformation">XSLT</abbr>.</p><p>a stripped down version of this experiment is used on this site's experimental <a href="/wishlist/">amazon wishlist</a> section.</p><p>tags: </p></div>
		</content></entry>
	<entry>
		<title>university of salford - construction of mary seacole building time-lapse</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/84"/>
		<id>tag:www.splintered.co.uk,2006-06-11:/experiments/84</id>
		<published>2006-06-11T00:00:00+00:00</published><updated>2006-06-11T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 1.7.0.0 on 2006-06-11T02:13:27 --><p>construction of the Mary Seacole building for the faculty of health &amp; social care at the <a href="http://www.salford.ac.uk">university of salford</a>.</p><p>time-lapse movie based on webcam stills gathered in the period between july 2004 and february 2006.</p><p><strong>warning: contains strobing/flashing images</strong>.</p><p><strong>note:</strong> in the later parts of the movie, you can spot the construction of manchester's 171m tall Beetham Tower (on the horizon, in the left-hand side of the shot).</p><p>music by the master of javascript himself, <a href="http://www.brothercake.com">james &quot;brothercake&quot; edwards</a>.</p><p>provided here is a link to the 58 <abbr title="MegaByte">MB</abbr> MPEG4 version. more formats available at <a href="http://www.archive.org/details/University_of_Salford_Mary_Seacole_construction">archive.org</a></p><p>tags: </p></div>
		</content></entry>
	<entry>
		<title>javascript fade</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/64"/>
		<id>tag:www.splintered.co.uk,2006-04-13:/experiments/64</id>
		<published>2004-11-05T00:00:00+00:00</published><updated>2006-04-13T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 1.6.2.0 on 2006-04-13T01:20:03 --><p> inspired by the fade-in effect over at <a href="http://www.couloir.org/"> couloir</a>, <a href="http://www.clagnut.com/blog/1299/">richard rutter discusses his plan</a> to recreate a similar bit of cross-browser javascript for his own experiment <a href="http://www.clagnut.com/sandbox/">sandbox</a>.</p><p> well, as soon as i read that, my own interest was piqued...and the result seems to be fairly workable. the main improvement over the original couloir code is in the area of accessibility: with my version, if javascript is unavailable or not enabled, the images are simply shown as normal...while previously they would simply have remained hidden behind the &quot;loading...&quot; layer. additionally, the messy browser sniffing has been replaced with a lean &quot;capability check&quot;. see the (reasonably well documented) source code for further details.</p><p><strong>updated to work in Opera</strong> - many thanks to <a href="http://mrclay.org/">steve clay</a> for the small fix.</p><p>tags: </p></div>
		</content></entry>
	<entry>
		<title>javascript cross-fade</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/65"/>
		<id>tag:www.splintered.co.uk,2006-04-13:/experiments/65</id>
		<published>2004-11-08T00:00:00+00:00</published><updated>2006-04-13T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 1.6.2.0 on 2006-04-13T01:19:51 --><p> based on the previous <a href="http://www.splintered.co.uk/experiments/64/"> javascript fade experiment</a>, this uses <acronym title="Document Object Model">DOM</acronym> javascript to turn a simple list of images into a cross-fading slideshow. simply add more list items to include more images in the slideshow. inspired by <a href="http://slayeroffice.com/code/imageCrossFade/">slayeroffice's image cross fader</a>.</p><p> as an exercise for the reader, this could also be extended to cross-fade any kind of block level elements.</p><p><strong>updated to work in Opera</strong> - many thanks to <a href="http://mrclay.org/">steve clay</a> for the small fix.</p><p>tags: </p></div>
		</content></entry>
	<entry>
		<title>splintered striper</title>
		<subject xmlns="http://purl.org/dc/elements/1.1/"></subject>
		<link rel="alternate" type="text/html" href="http://www.splintered.co.uk/experiments/80"/>
		<id>tag:www.splintered.co.uk,2006-03-16:/experiments/80</id>
		<published>2005-12-18T00:00:00+00:00</published><updated>2006-03-16T00:00:00+00:00</updated><content type="xhtml" xml:lang="en">
			<div xmlns="http://www.w3.org/1999/xhtml"><!-- Generated by XStandard version 1.6.2.0 on 2006-03-16T21:01:13 --><p>This experiment was originally posted on <a href="http://allinthehead.com/">Drew McLellan</a>'s web development advent calendar <a href="http://24ways.org/">24 ways</a> as <a href="http://24ways.org/advent/splintered-striper/"><cite>splintered striper</cite></a>. Following some feedback, it has been further refined. It was also posted to the <a href="http://webkrauts.de/2004/12/21/splintered-striper/" xml:lang="de">Webkrauts Adventskalender: splintered striper - Streifen machen schlank</a>.</p><h3>That slimming look</h3><p>Back in March 2004, <a href="http://www.fivevoltlogic.com/">David F. Miller</a> demonstrated a little bit of <acronym title="Document Object Model">DOM</acronym> scripting magic in his <a href="http://www.alistapart.com">A List Apart</a> article <a href="http://www.alistapart.com/articles/zebratables/"><cite>Zebra Tables</cite></a>.</p><p>His script programmatically adds two alternating <acronym title="Cascading Style Sheets">CSS</acronym> background colours to table rows, making them more readable and visually pleasing, while saving the document author the tedious task of manually assigning the styling to large static data tables.</p><p>Although <a href="http://www.alistapart.com/d/stripedtables/script.txt">David's original script</a> performs its duty well, it is nonetheless very specific and limited in its application. It only:</p><ul><li>works on a single <code class="inline">table</code>, identified by its <code class="inline">id</code>, with at least a single <code class="inline">tbody</code> section</li><li>assigns a background colour</li><li>allows two colours for odd and even rows</li><li>acts on data cells, rather than rows, and then only if they have no class or background colour already defined</li></ul><h3>Taking it further</h3><p>In a recent project I found myself needing to apply a striped effect to a medium sized unordered list. Instead of simply modifying the <cite>Zebra Tables</cite> code for this particular case, I decided to completely recode the script to make it more generic.</p><p>Being more general purpose, the function in my <a href="/experiments/archives/splintered_striper/striper.js">splintered striper</a> experiment is necessarily more complex. Where the original script only expected a single parameter (the <code class="inline">id</code> of the target <code class="inline">table</code>), the new function is called as follows:</p><p><code>striper('[<var>parent element tag</var>]','[<var>parent element class</var> or <var>null</var>]','[<var>child element tag</var>]','[<var>comma separated list of classes</var>]')</code></p><p>This new, fairly self-explanatory function:</p><ul><li>targets any type of parent element (and, if specified, only those with a certain class)</li><li>assigns two or more classes (rather than just two background colours) to the child elements inside the parent</li><li>preserves any existing classes already assigned to the child elements</li></ul><h3>See it in action</h3><p>View the demonstration page for three usage examples. For simplicity's sake, we're making the calls to the striper function from the <code class="inline">body</code>'s <code class="inline">onload</code> attribute. In a real deployment situation, we would look at attaching a behaviour to the <code class="inline">onload</code> programmatically &#8212; just remember that, as we need to pass variables to the <cite class="inline">striper</cite> function, this would involve something like:</p><p><code>window.onload = function() { striper('tbody','splintered','tr','odd,even'); }</code></p><p>Thanks to another <a href="http://www.unset.net/">Patrick</a> for this refinement from my original code, which suggested creating a wrapper function!</p><h3>Final thoughts</h3><p>This script is intended for situations where we want to style a large static document in the browser; if the document is generated dynamically via a server-side language, it would obviously make more sense to assign the alternating classes at that point instead of doing it client side.</p><p>Just because the function is called <cite>striper</cite> does not mean that it's limited to purely applying a striped look; as it's more of a general purpose &quot;alternating class assignment&quot; script, you can achieve a whole variety of effects with it.</p><p>And what about accessibility? Even though we're using javascript, we're only influencing the presentation and not the functionality or structure of the document. As long as the parent and child elements are already sufficiently styled, it doesn't make a difference in terms of accessibility (particularly for sighted users without javascript) whether or not the script is executed.</p><p>In (the not too distant) future we'll hopefully be able to avoid this whole palaver: when browsers consistently implement the <abbr title="Cascading Style Sheets">CSS</abbr> 3 specification, we'll be able to solve this problem in a far more elegant way with the <a href="http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#nth-child-pseudo">nth-child pseudo-selector</a>. But until then, we can certainly use a little <acronym title="Document Object Model">DOM</acronym> scripting to help browsers along the way.</p><p>tags: </p></div>
		</content></entry>
</feed>