The Kamusi Project

Return of the homepage slideshow

On the old Kamusi site we had a fun little slideshow feature. For the original slideshow, we uploaded a bunch of pictures in a folder on our server. When someone visited the homepage, one of the pictures would load randomly, and then another random image would load 15 seconds later. The feature did not work well on all browsers, so we eventually replaced it with a script that loaded a random image from the folder, and then enabled the user to scroll through the remaining images.

When we moved to our new server, we decided that we wanted a customized slideshow that could show the pictures that Kamusi community members have uploaded to illustrate dictionary entries. Each photo would link to the entry with which it was associated, so the feature would be a good way to introduce people to new words. We also want to encourage people to use the photo uploader feature, and we're hopeful that people will be motivated to contribute images by seeing their pictures in the slideshow.

Dictionary image submitted by a Kamusi community member (click photo to see the word it illustrates):

Unfortunately, writing the code for this new version of the slideshow has not been easy. We got something that worked okay on Firefox (the browser used by 38% of our visitors), but not by Internet Explorer (used by 52%). And then we got distracted by more urgent business, so for a few months we have had a half-finished slideshow sitting forlornly on the bottom of our homepage.

We finally got the slideshow to work in all browsers, but a few issues remain.

The first is a series of math problems, and it looks like Henry will have it solved before I finish this blog post: every picture has different dimensions, but we have to get it on-screen at a maximum size, without stretching or distortion, and with the frame properly sized around the image. (Update 5 minutes later- this is complete.)

The second issue is a little trickier. Right now, although the image links to the dictionary entry, we cannot tell you what that entry is. So we have to make the script find the word (in Swahili and English) from the database, and include that in the picture's caption.

The final issue has to do with the way we store images in our database. Unfortunately, the images are stored in separate folders for each dictionary entry. This means that we cannot have the script run randomly through all the images; in the code as it exists as I write this blog entry, if you want to see a new image, you need to refresh the page. So the last improvement we need to make will be to fool the script into thinking that all the Kamusi photos are actually stored in the same place.

Once these three pieces are worked out, the slideshow will be working the way we've imagined it. Meanwhile, it is good enough to introduce in beta version, as seen above. If you see the image changing every few seconds, that means the slideshow is completely done.

Search

English - Swahili
Swahili - English

Urambazaji

Kuingia kwa watumiaji