MagWords Demo

This is a demo of MagWords, a little thing I put together to play with the darg & drop capabilites in jQuery. Based on the magnetice words that grace thousands of refrgerators around the world. It wasa fun little project and a good learning experience. Click the link below if you'd like to download the source code and play with it yourself. Feel free to use this code however you'd like.


To setup a MagWords instance on your webpage add something like the following code:

var mw = new MagWords( {
	"width": 500,
	"wordSets":{ "Carroll":"jcarroll", "Shakespeare":"wshakespeare", "Swift":"jswift" } 

Option Definitions

  • container (required) - the id of the dom element that MagWords will live in.
  • width (optional) - the width you want the MagWords board to be. It left blank it will fill the container.
  • height (option) - the hieght of the MagWords boards. It will default to 400px if not specified
  • wordSets (optional) - You can create other collections of words to use if you so desire. These are just Javascript arrays that contain the words you want to use. The word will be chosen randomly.
  • maxWords (optional) - The number of words you want to display. Defaults to 40.
  • currentWordSet (optional) - The word set you want to start with. Defaults to the internal word set if not specified. You'll need to include your word sets in a .js file. See the words.js file for examples