- We design and build extraordinary applications for companies looking to make the next great idea a reality.
- learn more
A Spinner Widget
Update: I've added the controls to spin forward an backward, mouseover effects on the image and a simple onclick action.
I've been working on a spinner widget. "What is a spinner widget?" I heard you cry. If you've seen those flash widgets on Amazon that spin product images around in 3D, you know what I mean. I wanted to see if this could be done in pure DHTML. Well, it can, see image below and a demo here.

The widget uses projection geometry (a view point and calculating image size and position based on where lines pass through the z=0 plane) and a little bit of trigonometry for the circle. Also, zIndex is set based on an object's z coordinate. At this stage the implementation definitely performs differently based on machine horsepower and browser platform. It performs pretty well on IE7 and Safari 3, less well on Firefox.
The implementation is in GWT 1.5 (built from SVN), but could be done in pure JavaScript (obviously). Next steps include direct manipulation of the spinner (drag to spin the circle) and drag and drop, response to clicks on images, the ability to spin arbitrary DOM elements, etc. Also, I want to squeeze some better performance by using an image strip (clipped with CSS). Stay tuned.
Technorati Tags: ajax, gwt, widget, 3D
Topics: Ajax Widgets, GWT
Comments: 9 so far
Leave a comment
About Pathfinder
Recent
- Push Button Phones and the Limits of User Testing
- Firefox Plugin Malware ‘Trojan.PWS.ChromeInject.A’
- Pathfinder releases version 1 of the its Flash Platform microsite (codename Mica)
- Pimp my Rails: Five Plugins & Gems to Make Rails Better
- iPhone: Using Pre-processor Directives for Device Testing
- Subtle OpenGL Projection Matrix Difference Between iPhone Simulator and Device
- App Security: Throw Out the Org Chart!
- Pimp my jQuery: Five plugins to replace the features Prototype and Scriptaculous users expect
- Thanksgiving 2008: What We’re Thankful For (In Rails)
- iPhone SDK: Testing with TextMate & GTM
Archives
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006


That’s really nice. We don’t have the capability to skew as the items rotate to the back, but eventually DHTML and SVG combined would give us that.
Comment by Shelley, Friday, December 14, 2007 @ 11:37 am
That’s a very neat application. I’ve long thought about trying to design a sort of “Product Demo” using all DHTML, where you can click different parts of the product and get more info about it. You see things like that alot, but it’s always flash based. It’s good to see that something like is doable, especially being so lightweight for its size. As for performance, it works better in Firefox than IE7 on my machine.
Comment by T.J., Friday, December 14, 2007 @ 12:20 pm
Very nicely done. Ditto T.J.’s comment - the performance, smoothness is better in FF v2.0.0.4 than IE v7.0.5730.11 on my machine.
Comment by ewb, Friday, December 14, 2007 @ 9:55 pm
Very Nice.
Where can i download the widget ?
Regards
Comment by Luciano, Saturday, December 29, 2007 @ 4:14 am
rock solid-one !! after seeing ur work i realised the GWT
..can i see the source code for that?>?
Comment by teja, Tuesday, January 8, 2008 @ 3:03 am
Nice work!
I’ve been working on another graphically-centered widget for the incubator:
http://devcenter.yesmail.com/com.yesmail.magellan.gwt.rolodexdemo.RolodexDemoApp/RolodexDemoApp.html
This uses an ImageBundle-like interface to let the big image manipulation work to happen at compile time (via deferred binding).
This works well as an api, since you can do things like this:
public interface HelpMovies extends RolodexCardBundle {
RolodexCard welcome_clip1_btn();
}
…in onModuleLoad
HelpMovies helpMovies = (HelpMovies) GWT.create(HelpMovies.class);
RolodexCard clip1 = helpMovies.welcome_clip1_btn();
clip1.addClickListener(new ClickListener() {
public void onClick(Widget widget) {
Window.alert(”clip1 clicked!”);
}
});
RolodexPanel rolodex = new RolodexPanel(helpMovies);
…which is a nice intuitive way to deal with drag-and-drop and click handling.
Comment by Chris Jones, Monday, January 28, 2008 @ 1:08 pm
Is the source code available for both or either of those two awesome widgets?
The “Spinner” and “Rolodex”
Thanks
Comment by Matt Weiler, Friday, March 14, 2008 @ 10:10 am
Very Nice widget…but if you can not share the code, why the hell are you telling about this?Look bro always try to share your knowledge with others….
Comment by WebEye, Wednesday, July 9, 2008 @ 6:15 pm
@WebEye
No desire to hide the code, just a lack to time to make it more generally useful and package it up. Also, there’s a bug with the initial loading and positioning of images that I’d like to fix.
Comment by Dietrich Kappe, Thursday, July 10, 2008 @ 10:13 am