simple Slide Puzzle in JavaScript (mootools)

So I finally decided to try out one of these JavaScript libraries … and what better way than to create a Slide puzzle. I chose mootools because of there modular download … it’s pretty slick. My goal was to make it simple for users:

 

– include the source file
– add one DIV with IMG
– no need to slice up image

usage…

//ADD SCRIPT TAGS

//ADD DIV ID PUZZLE WITH IMG

alt

//CALL FUNCTIONS functions
//makes 3x3
Puzzle.make(3);

//shuffles puzzle
Puzzle.shuffle();

//fixes puzzle
Puzzle.fix() ;

//switch image
Puzzle.switch_image('xyz.jpg')

Download: http://www.htmldrive.net/items/download/733

Leave a comment