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.

Examples:

cell2page0

cell9page102

cell10page0

Code for parsing out the cell’s number:

1
parseInt(jQuery(peeker).attr("class").substring(4,5))

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:

1
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

Fancy Footer Update

I’ve updated the Fancy Footer snippet, now Trackbacks/Pingbacks will be able to find your posts – the previous version’s implementation was … lacking.

No comments | Trackback

Search Box Above Nav Menu with Rapidsearch 2.0

This is a short tutorial that aims to explain how to place a search box at the top of the sidebar, above the navigation menu. This will require some fiddling with code – don’t be afraid! I’ll do my best to walk you through it.

No comments | Trackback

Styling JS-Kit Comments

Styling JS-Comments is really quite straightforward. I strongly recommend you read this post before moving on, as it contains tips on resizing JS-Kit elements, such as the width/height of comments, among other things.

Comments (2) | Trackback