Thursday, 26 March 2009

Hacking and cobbling stuff together

I'm rather pleased with myself... it's been a hard old slog over many days to achieve the gadget-ified scrolling image selector you (hopefully) see here.



...and I'll finish writing this post when I can see it works (after the usual test, test and test again)!

Ok, it does - and with only a minor hiccough (see if you notice!).

So, why was it all so hard?

Well, first of all, what actually is going on here? Hover with your mouse to the left of centre, and the piccies scroll towards the beginning of the gallery, and vice versa.

Click on a thumbnail, and it takes you to a page (opens in a new tab) with a larger version of the picture, showing what it looks like in a frame, and letting the visitor buy one of the limited editions of that picture, using PayPal as the payment processor.

Well, in the dim and distant past I once saw someone who claimed they were "doing programming" and, when I looked over his shoulder, thought it all looked a bit like witchcraft to me with strange runes, spells and incantations.

Little did I know I'd end up wrestling and doing battle with the slippery little things! It only began to dawn on me when I was researching how to achieve my vision above, that I was going to have to do a bit of "programming" myself.

I use the term cautiously, it was more akin to hacking and chopping, with a fair bit of kludging, hair-tearing and plead-offerings to the
bittybyte silicon gods of the megaverse, thrown in as well.

And there was me thinking, a quick search on google to find a suitable bit of javascript, a deft bit of cutting and pasting and chucking in my own urls and... done deal, or so I niaively thought :)

Once it was all hanging together (small word "once", to really get the meaning across, I need a word that echoes trail blazing over virgin mountains during a blizzard, while suffering from snowblindness and frostbite in eleven toes, or crossing the vast desert plains of the kalahari with only a swiss army knife, a small flagon of dehydrated water to hand and an impromptu overly-friendly "hopping" bird for company, "once" just doesn't seem to cut it) it was easy enough to google gadget-ify it.

..And the problem, well it's not fully transportable - when the scroller has less than 500 pixels to display in, the javascript that drives it still thinks the center is 250 pixels from the left. The width of this blog means the google gadget that contains it can't be wider than 400 pixels - the end result is that to scroll to the right you need to hover much further than right of center than you should.

Obviously my plead-offerings to the gods weren't quite up to par!

If only I knew how to change the javascript to make it right. Hmmm.

I suppose I should say, the advantage of having it gadget-ified is that it is dead easy for friends (and people who find it in the google gadgets directory and who like it enough) to add it to their blog, website etc. See how easu it is yourself, just click the google + button under the scroller to see just how easy it is.

Post a Comment

LinkWithin

Related Posts with Thumbnails