with Imagination: by Dustin Diaz

./with Imagination

A JavaScript, CSS, XHTML web log focusing on usability and accessibility by Dustin Diaz

JavaScript Carousel

Wednesday, July 12th, 2006

To be totally fair, Bill Scott defined the slide transition first. It was only then when I decided to whip up some actual JavaScript using YUI to make it happen. Being as it may, in return, Bill scott took to it and decided to spend a weekend beefing that up into something that made sense with his JavaScript Carousel Component which allows you to configure it in various ways for slide transitions, amount to show at a time, how fast to slide etc… as well as having it load statically, dynamically without Ajax, dynamically with Ajax, slideshows, and of course, it can degrade to even not having JavaScript at all.

With all that in mind, if anyone out there is looking for an awesome implementation of any kind of sliding pagination, I urge you to check out his examples and carousel API. It’s pretty awesome.

13 Responses to “JavaScript Carousel”

  1. Arjen Geerse

    Hi,

    I’ve been working on this earlier. My version can be seen at http://www.seat.nl and http://www.vangoghmuseumshop.com

    My soultion only needs about 7K of javascript.

    Cheers,

    Arjen

  2. ChadL

    Nice one Arjen; a little cleaner than the one I implemented for Nintendo a while back; both are circular though and Dustin’s and Bill’s are not.

    Here’s the one I built, err… hacked together:

    http://examples.chadlindstrom.ca/dhtml-shifter/
    http://www.nintendo.com

    Does yours do horizontal as well?

  3. Johan

    another *Dutch* making (Hollandse makelij)

    http://www.funda.nl/koop/

  4. Johan

    http://examples.chadlindstrom.ca/dhtml-shifter/

    in your js you sniff for gecho

    var isGecko = (ua.match(’gecko’) != -1 );

    Gecko is an animal I believe

  5. Dustin Diaz

    I’ve found the Nintendo example a little hard to follow. Eg. I don’t know where I end up in comparison to where I started.

  6. Kevin Hoang Le

    Dustin,

    Both yours and Bill Scott’s implementations are nice. Your site is also one my favorite web sites (in term of both contents and presentation) that I visit frequently and I list as such on my own web site (your tetris game is awesome). Anyway, I also had a need to develop a similar component about a month ago, but in my case, the requirement is such that I must use scirptaculous. Fast forward to a month later, I turned it into a Javascript library with hooks for customizations.

    You can check out the demo at http://slidinggallery101.pragmaticobjects.org/

    Kevin Hoang Le
    http://pragmaticobjects.org

  7. links for 2006-07-14 // willkoca

    […] JavaScript Carousel (tags: yahoo javascript usability) […]

  8. ChadL

    @Johan: yea, as I put it above; it was a bit of a hack given it was put together for a client in a short timeframe.

    @Dustin: is it the code you can’t follow or the function of the carousel?

  9. Web Tool

    Thanks for publishing the link to this carousel script. I’ve been needing something like this, and dynamic drive dot com has some similar ones, but I liked the interface of this the best. Thanks for the tip ! :)

  10. Daniel

    Dustin, I really like your
    http://www.thinkvitamin.com/misc/yui-demos/demo-04.html

    very lightweight compared to Bills full featured component. What would be the best way to use it, when you have several sliders on one page. Could you give me a hint? thanks

  11. Dustin Diaz

    @Chad, it took me just a few moments to understand what was really going on just visually. the code is all good :)

    @Daniel, it might be best to use Bill’s in that case. Most of my prototypes were hacks written up out of sheer hackery and proof of concept.

  12. kmb40

    I’ve been trying to implement this for links only, no photos - a one row carousel for just links. I tried using the YUI component that has the images sliding horizontally, but it’s too image-centric for the job… the hack is more than ugly… it doesn’t work. Furthermore, the vertical text scrollers I’ve found are nearly impossible to turn horizontal. I’ve really been struggling, any suggestions? I’ve been trying to get a one row carousel for links only

  13. me

    Don’t you just hate a web site like this one… don’t click on the link
    its one of those.. no back out of…. GARBAGE…

    Oh yes…it take you some where else…..Bastards!
    http://www.seat.nl and

Leave a Reply

Phone Number:

If you're about to post code in your comment, please wrap your code with the tag-combo <pre><code>. Also please escape your html entities - otherwise they will be stripped out. I recommend using postable.

Get "JavaScript Design Patterns"

"As a web developer, you'll already know that JavaScript™ is a powerful language, allowing you to add an impressive array of dynamic functionality to otherwise static web sites. But there is more power waiting to be unlocked--JavaScript is capable of full object-oriented capabilities, and by applying OOP principles, best practices, and design patterns to your code, you can make it more powerful, more efficient, and easier to work with alone or as part of a team."

Buy JS Design Patterns from Amazon.com Buy JS Design Patterns from Apress

Flickr

Submit a Prototype

All content copyright © 2003 - 2007 under the Creative Commons License. Wanna know something? Just ask.

About | Archives | Blog Search

[x] close

Loading...

Submit a prototype

By checking this prototype I agree that I am not submitting false credentials, pornography, or a hate crime website. I also understand that by submitting my entry I may or may not be accepted, and if accepted, my entry may be taken down at any given time if I violate these terms.