This demo shows how to easily create a puzzle using jQuery and Interface.
It is far from perfect, the shuffle function sometimes even generates a solved puzzle, but you'll get the idea. :-)
I kept everything in this single file so you'll get an impression without crawling throught seperate files.
You can contact me at email@example.com - I am happy about your feedback!
See it in action on my other website at http://www.pagodentreff.de/mercedespuzzle/ (German).
The code itself is pretty simple. On the one hand we have the new function generatePuzzle which fills the specified layer (default: puzzle) with the images you specify.
On the other hand we have the code that actually generates the puzzle using a very nice plugin to jQuery called 'Interface'. Without it this puzzle won't exist because it made the rest super easy. :-)