spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / dhtml / column11
Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management
Logo

The DHTML Lab Jigsaw Puzzle, Part IV: Cross-Browser
solving and setting the grid


Our random number generator, that creates x-y coordinates for piece positioning, remains exactly the same:

Setting the Grid

Our setGrid() function is, again, a combination of the browser-specific codes, with no new statements.

Solving

Recall that in our HTML, we changed the function called by the Solve and Hint buttons to preSolve(), to avoid the double auto-solve problem. preSolve() filters any solve calls, disallowing solves, if:

If a solve should be allowed, preSolve() calls our old solve function.

solve() is a simple a combination of the two browser codes, with one important addition. If a full auto-solve is called for, that is, if isFullSolve is true, isSolving is set to true, allowing filtering of any further user presses of Solve:

Finally, let's look at the remaining miscellaneous functions of our main script.


Produced by Peter Belesis and

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
MS Access and MySQL · Cisco AutoQoS: VoIP QoS for Mere Mortals · While VoIP Adoption Explodes in Enterprise, Carrier Spending Lags

All Rights Reserved. Legal Notices.
Created: Dec. 17, 1997
Revised: Jan. 18, 1998

URL: http://www.webreference.com/dhtml/column11/puzzCBsolve.html