I’m creating a wizard (really, a glorified survey) using jQuery Wizard Redux. I have several images (created in Illustrator) which I want the user to select from, which would act as their “submission” for each step of the wizard.
e.g. this world map I made in Flash Catalyst.
(sidenote: I want the wizard to be viewable on an ipad/iphone so I’m shying away from Flash at this point)
Is it possible to create something similar using jQuery/Javascript? Some of the regions are quite complex – for instance, the “East Asia” section of the map is made up of 6 different invisible rectangular buttons so that (nearly) everywhere in black registers as a click for “East Asia”.
Alternatively, is there some easy way to convert my flash catalyst files (which are coded in MXML) into javascript?
You could use an image map by defining a map and area elements (polyline) for each region.
update
I would create transparent
.pngfiles that get overlaid (each one holding a region) and control their opacity when clicking on the area elements.coordsfrom your clicks)http://jsfiddle.net/gaby/CKJwp/41/
http://jsfiddle.net/gaby/8qgfS/29/
Update 2
You can use the
relattribute of the region images to store the value likeNow, since we add a class
selected-regionto define the selected region we can use jQuery to target the image with that class, and retrieve the value stored in itsrelattribute.so when you want it you can use
var regionId = $('img.selected-region').attr('rel');