In my last post I talked about using the “Better Coda Slider” created by Remy to create the testimonial slide show on the Enhance Dental Centre. While working on this, I ran into a problem. Instead of using a single image when moving from image to image, I wanted to use a rollover image. I looked at the thread of comments on Remy’s blog post and noticed that I was not alone in wanting this and that no one had offered a solution.
Possibly because of my stubbornness I tried all sorts of CSS tricks and hacks and couldn’t get the damn rollovers to work. In the end, the solution was pretty obvious, in fact a bit embarrassing.
I asked Ben to look at my code and in my coda-slider.js file, he simply changed
.before('<img class="scrollButtons left" src="/images/left.gif" alt="" />')
.after('<img class="scrollButtons right" src="/images/right.gif" alt="" />');
to this:
.before('<img class="scrollButtons left" onmouseover="this.src=\'images/left_hover.gif\'"
onmouseout="this.src=\'images/left.gif\'" src="images/left.gif" alt="" />')
.after('<img class="scrollButtons right" onmouseover="this.src=\'images/right_hover.gif\'" onmouseout="this.src=\'images/right.gif\'" src="images/right.gif" alt="" />');
Doh! I was trying so hard to do my rollovers with css, that I forgot the “old school” way of doing this.
In case anybody is interested in re-creating this example, here are the files are zipped up for you to play with.
Unless your a web developer you might not have heard about jQuery. As defined in Wikipedia, “jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML”. Released in 2006, it’s use is very common on many websites, yet, I’ve never had a chance to play with it, until now.
Inspired by a beautiful design by Mizu Creative, my task was to convert the design into a WordPress based website enabling the client to make edits themselves and insert a series of slide shows with different behaviours. Converting the design into WordPress templates was a breeze, but finding a way to integrate the slide shows proved challenging. My initial thought of course was to use flash, but flash is expensive, annoying, hard to update and quite frankly, I don’t like it. I knew that Tzaddi had recently built a WordPress site where she used jQuery, so I thought I would investigate.
After a couple of Google searches, I found exactly what I needed.
InnerFade by Medienfreunde
The first demo I found was the InnerFade plugin. As the name suggests this plugin allows a series of text or images to fade in and out.
I’m not exactly sure who created this code, because my German is non-existent, but using his/her demo, I found the solution for one type of slide shows and used it on several sections of the Enhance Dental Centre website including this page, where you can see a series of before and after shots fading in an out.
Better Coda Slider by Remy Sharp
The second demo I found was the better coda slider. The aim of Remy‘s demo was to look at the original effect used on the Coda site and improve on it. Once again, using his example and making a few adjustments, I was able to use the code and create a “slider” effect where users can view the various testimonials.
All in all, I’m very pleased with the final outcome of the site. What proved to be daunting and challenging initially, turned out to be fairly simple and I look forward to playing with jQuery on more sites. What are your thoughts?