Archive for September, 2006

Tips For Business

Friday, September 29th, 2006 at 2:12pm

I was perusing Derek Featherstone’s blog the other day (entitled Box of Chocolates, which immediately got my attention!) when I came across two articles of interest about success in business:

Five Business Mistakes I’ve Made
Ten Smart Moves to Improve your Business

Both contain wise words, which are now of particular relevence to me, since I heard yesterday that my current employer has agreed to let me take voluntary redundancy in the New Year. Looks like I’ll be working my notice and then free to set up my own freelance design & development company with my payoff! All very exciting, and just a little scary; but I’m looking forward to the challenge immensely.

Playpen #3 - Changing Your Stripes

Wednesday, September 27th, 2006 at 4:11pm

You know what they say about Leopards… well at least you can get a table to change its stripes with a bit of DOM scripting.

It’s a fairly trivial problem, but seeing as I’m pretty green when it comes to unobtrusive JavaScript, it’s somewhere to start!

The Playpen #3 page shows off the table, which has a new class added on alternate rows, and defines a new background colour in the CSS. OnMouseOver will change the class again, to give another colour. But I’m having real trouble resetting the original class/colour onMouseOut… It’s probably because the DOM is changed on the fly, and the original (not moused over) state of the alternate row is never actually “stored” on the page. If anyone has any suggestions, I’d be very interested to hear.

For the record, my stripeTables script looks like this:

function stripeTables() {
if (!document.getElementsByTagName) return false;
var tables = document.getElementsByTagName(”table”);
for (var i=0; i<tables.length; i++) {
var odd = false;
var rows = tables[i].getElementsByTagName(”tr”);
for (var j=0; j<rows.length; j++) {
if (odd == true) {
addClass(rows[j],”altrow”);
odd = false;
} else {
odd = true;
}
}
}
}

addLoadEvent(stripeTables);

And this is highlightRows:

function highlightRows() {
if(!document.getElementsByTagName) return false;
var rows = document.getElementsByTagName(”tr”);
for (var i=0; i<rows.length; i++) {
var rowclass = rows[i].getAttribute(”class”);
rows[i].onmouseover = function() {
addClass(this,”highlight”);
}
rows[i].onmouseout = function() {
this.setAttribute(”class” , “rowclass[i]“);
}
}
}
addLoadEvent(highlightRows);

I thought getting the Class attribute and storing as rowclass would allow me to reset it to what it was before the onMouseOver event, but sadly the table rows become unstripey once they are moused over!

The only other way I can think of doing it is writing some sort of subtractClass script to complement addClass, but seeing as this will almost certainly involve hideous regular expressions, I’m rather shying away from that.

Anyone have any ideas what I’m doing wrong?

Upcoming Events

Sunday, September 24th, 2006 at 8:44pm

I’ve recently signed up for Upcoming.org so I can keep an eye out on what’s in the pipeline in the near future. Two events caught my eye, coincidentally on consecutive evenings (all we need is a third one and they’ll be like London Buses…)

Thursday 19th October
Web Standards Group Meeting # 2 where Microformats will be discussed. See Muffinresearch.co.uk for more details.

Friday 20th October
London Geek Dinner, special guest Molly E. Holzschlag. See the Geek Dinner website for more details.

Both events look like a good evening; perhaps I’ll see some of you there.

Playpen #2 - Lightbox JS

Saturday, September 23rd, 2006 at 11:09pm

The d.Construct Backnewtwork has a neat feature which hooks into the Flickr API and pulls out all suitably-tagged images of the conference. Then when you click an image, it appears in a rather sexy overlay window.

I’ve been looking for some time, for an unobtrusive javascript method of displaying a photo + caption in a popup, as I have several sites which require this feature, without needing to go for the overhead of dynamic pages or a page per image. Trouble is, most of the methods I’ve found haven’t been friendly if you turn off JavaScript!

The latest issue of .Net magazine (#154) also has a tutorial on Lightboxes (Javascript Image gallery widgets), so I thought I’d give Lightbox JS a try.

It works great straight out of the box, is dead easy to inplement, and will let you customise quite a few features. If users have Javascript disabled, they still get to see the content (the larger image when you click on the thumbnail, albeit in a boring vanilla window), so it’s fine from an accessibility standpoint. And I’m pretty sure it’s the very same method the backnetwork uses.

I knocked a quick gallery together, which you can see at the Playpen #2 page.

Beta Blockers?

Thursday, September 21st, 2006 at 10:47am

Blogger has a new beta version out and is inviting bloggers to move over from their existing account. This involves signing in with a Google account - either using an existing one, or signing up for a new account.

Using systems in beta can be a “fun” experience - you might be the person to come across that little-known bug which completely ruins your day! Or you might find that all the new features are worth the little rough patches while everything gets ironed out.

I’ll admit I’m dithering over whether I should jump ship and go for the beta release. There are certainly some great new features like the ability to restrict read access and add “labels” (tags to you and me) for searching and categorising your blog posts. OK, these two are features which other publishing systems like WordPress have had for some time (and I know of folks who have defected to WordPress from Blogger in the past due to these deficiencies).

One “hidden” benefit is their new dynamic serving of pages. In the past, you had to “Publish” each new entry or the whole blog when you made changes, to give the static HTML pages which made up your blog. If you forgot to republish, the changes weren’t seen until the next time you republished. This was pretty tedious and took quite a while if you had large blog. In the new version, changes are made to the database immediately and each page is served dynamically on the fly at each request. No more waiting for the spinning logo to finish its whirling!

My ideal scenario would be to move just one blog (probably the RugbyMad one) and play with it for a bit to see if I have any problems, before moving this blog too. But it’s not clear from the support info if I can do this - effectivley, both blogs are linked from one account, and I think it’s the account I’m moving and not the blog specifically.

Anyway, if you’re interested in what new features are in the beta release, here are a few links for you to digest: