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!
Like this post? Move it on along with:
Email |
delicious |
Digg |
Tweet |
Reddit |
Newsvine |
Furl |
Google |
Stumble |
HaoHao
| Trackback: |
Related posts:
- Accidentally Broken, Accidentally Fixed I managed to fix the problem, accidentally....
- Slider Update – Tab Feature Coming Together Scroll to comments As I finally reached a programming goal I had set – the tab hover javascript was working fairly well – I realised that users would want the option of positioning the tabs in the middle or corners of Slider’s four sides. Initially I had assumed it would be OK for users to have [...]...
- Slider Progress: Slider Styling Option Pane Scroll to comments During the great rewrite, I’ve been trying to focus on one section at a time. The first section to come under attack was “everything pertaining to the styling of Slider that is not Arrow-related”. After much mucking-about I decided to combine the Border, Rounded Corner, Background Image, Gradient and Background Colour onto one [...]...
- JS-Kit Comments: Correct Usage of the ‘Permalink’ and ‘Path’ Attributes Scroll to comments It took me awhile to understand what the ‘path’ attribute was for, and the differences between it and the ‘permalink’ attribute. I couldn’t find a clear explanation that explained the differences, and how one should use these attributes. I’ll explain the differences and how I use the attributes here. Both attributes should [...]...
- Drag and Drop Reordering of NSTableView’s Rows Scroll to comments I just had to re-implement drag-and-drop-reordering of Slider cells. I was lucky enough to find my post on the Cocoa-dev list – I just had to copy-paste the code. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28...





























Recent Comments
The Best Photographer In Shanghai
When we pick them up :( Don't know when that will be yet!
Chose another 49 today
Wed, 13 Jan 2010 14:13:21 +0000
The Best Photographer In Shanghai
When do we get to see them!!!!!
Tue, 12 Jan 2010 19:08:51 +0000
Installing Jdownloader In Ubuntu
Thank You!!!!
It works like a charm!!!!!!!!!!!!
Tue, 05 Jan 2010 13:02:35 +0000
Arrived In Shanghai
Done, look left!
Sun, 03 Jan 2010 15:37:03 +0000
Arrived In Shanghai
Hi :)
I'll see what I can do!
Sun, 03 Jan 2010 14:23:07 +0000
Arrived In Shanghai
Hi Mike. It would be very useful to have the time date and weather conditions in Shanghai, on your site. Be seeing you soon. Love NZMum.
Sat, 02 Jan 2010 23:30:41 +0000