Products – 产品

Accidentally Broken, Accidentally Fixed

I managed to fix the problem, accidentally.

No comments | Trackback

Short-Sighted Programming

Today a customer informed me that Slider wasn’t working properly on his webpage. They gave me the URL to the problem page, and for a page with a working (properly) version of Slider.

Initially I was perplexed, but it dawned on me that the code for parsing out the cell numbers can only parse single-digit numbers.

A classic case of short-sighted programming.

See the cells’ class attribute was put together like this:

cell + the cell’s number + unique ID.





Code for parsing out the cell’s number:


Notice that it only gets one character.

To work correctly, two things needed to be changed.

First, I had to change the way the cells’ class attribute is put together:

cell + unique ID + the cell’s number

Second, the javascript for parsing out the number:

parseInt(jQuery(peeker).attr("class").substring(("cell" + length of cell + unique ID),(length of class attribute)))

The updated plugin is available here: Slider 0.95b

I’m confident that I’ve fixed the problem, but if I haven’t don’t hesitate to let me know!

Incidentally, the customer’s website is extremely well done, go and check it out!

John Charlton Webdesign

No comments | Trackback

JS-Kit Comments + Greybox on Any Page

I realised that I didn’t want comments to be visible on the page in case one set of photos became wildly popular (yeah, right); which would result in a page of comments with a few photos, instead of a page of photos with maybe one or two comments. For some reason, Greybox popped into my head, and wouldn’t leave. A few hours later, this happened: Hangzhou Day 1.

No comments | Trackback

Home Stretch

Somehow I screwed everything up again, and had to go through a few hours of frustration and confusion.

No comments | Trackback

In Case of Frustration, Bang Head Here

So I spent the last six hours beating my head against my keyboard.

No comments | Trackback