spacer

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

home / experts / dhtml / column8
Developer News
MicrosoftÂ’s Automated Agent: Can We Talk?
Borland Finally Sells CodeGear
Red Hat Heads For The JON 2.0
Logo

The DHTML Lab Jigsaw Puzzle, Part I:
creating a low-bandwidth customizable puzzle in Explorer 4


This tutorial can be appreciated by users of any browser, any version. The in-line puzzle will only work in Internet Explorer 4, Release, for Windows 95. The Macintosh Release Version does not support the CSS "clip" property, on which much of the puzzle is based.

A Netscape Navigator 4 version will, of course, soon follow.

Our puzzle example uses art works by M.C. Escher, an artist whose brilliant pieces are puzzles onto themselves.

All M.C. Escher works (c) Cordon Art B.V.-Baarn-the Netherlands.
All rights reserved. Used by permission.


With the introduction of DHTML positioning and drag and drop capabilities, the web is hosting a growing number of variations on the jigsaw puzzle theme. Why, then, do we feel the need to create yet another one? Ours, simply, is completely different from any that we have seen so far.

The Dynamic HTML Lab Jigsaw Puzzle:

Try it for yourself with the puzzle below. Drag it to any position that suits you. If you find the drag capability annoying, turn it off with the labeled toggle button. Break the puzzle into as many pieces as you want. Break it again. Move the pieces into position to solve it. Stuck? Use the hint button. Fed up? Let the puzzle solve itself with the solve button. Load a new puzzle image and play with that one for a while. The images have not been pre-loaded, so you will have to wait for a download when you switch images. At any stage, an optional grid can be turned on and off to assist in piece placement. If the puzzle has a low piece count, the grid may slow the puzzle down. We'll learn why later. When you're ready, read on to learn how we created it.


Screenshot of Puzzle for non-IE4 browsers

The Basic Concept

As you have guessed, the puzzle is not composed of smaller images. It takes user-supplied parameters and clips the original image, creating a puzzle piece. The cached original image is loaded-and-clipped, loaded-and-clipped until all pieces are created. This allows us to use any GIF or JPG as a puzzle by simple loading it.

In this column our script is long, because we are dealing with an application, as opposed to a technique. Almost all the component techniques have been discussed before. Therefore our approach will be more-or-less linear. We will go through the completed application step-by-step. The code can be found, as usual, in our Complete Code pages (this time we have more than one). Refer to it often as we proceed. In fact, it would be best to take a quick glance now before we move on

In This Column

We will discuss:

Before we can begin our cool puzzle effects, we must first create it, and place it on our page.


Oracle Information-Driven Business Center:
DVD OFFER:
Get Started with Oracle on Windows DVD
WHITEPAPER:
Will Your Database Measure Up? Oracle Database 11g vs. Microsoft SQL Server 2005
WHITEPAPER:
Innovate Faster with Oracle Database 11g
WHITEPAPER:
Oracle Application Express Overview 3.0

Produced by Peter Belesis and



JupiterOnlineMedia

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

Solutions
Whitepapers and eBooks
Microsoft Article: HyperV-The Killer Feature in WinServer ‘08
Avaya Article: How to Feed Data into the Avaya Event Processor
Microsoft Article: Install What You Need with Win Server ‘08
HP eBook: Putting the Green into IT
Whitepaper: HP Integrated Citrix XenServer for HP ProLiant Servers
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 1
Intel Go Parallel Portal: Interview with C++ Guru Herb Sutter, Part 2--The Future of Concurrency
Avaya Article: Setting Up a SIP A/S Development Environment
IBM Article: How Cool Is Your Data Center?
Microsoft Article: Managing Virtual Machines with Microsoft System Center
HP eBook: Storage Networking , Part 1
Microsoft Article: Solving Data Center Complexity with Microsoft System Center Configuration Manager 2007
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Intel Video: Are Multi-core Processors Here to Stay?
On-Demand Webcast: Five Virtualization Trends to Watch
HP Video: Page Cost Calculator
Intel Video: APIs for Parallel Programming
HP Webcast: Storage Is Changing Fast - Be Ready or Be Left Behind
Microsoft Silverlight Video: Creating Fading Controls with Expression Design and Expression Blend 2
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Sun Download: Solaris 8 Migration Assistant
Sybase Download: SQL Anywhere Developer Edition
Red Gate Download: SQL Backup Pro and free DBA Best Practices eBook
Red Gate Download: SQL Compare Pro 6
Iron Speed Designer Application Generator
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
How-to-Article: Preparing for Hyper-Threading Technology and Dual Core Technology
eTouch PDF: Conquering the Tyranny of E-Mail and Word Processors
IBM Article: Collaborating in the High-Performance Workplace
HP Demo: StorageWorks EVA4400
Intel Featured Algorhythm: Intel Threading Building Blocks--The Pipeline Class
Microsoft How-to Article: Get Going with Silverlight and Windows Live
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Perl Pragma Primer · Implement Drag and Drop in Your Web Apps: Part 2 · How to Create an Ajax Autocomplete Text Field: Part 5
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
SQL Server 2005 Express Edition - Part 22 - Upgrading from Microsoft SQL Server Desktop Engine (MSDE) · Vyatta: Downgrades that Pay Off · NetMotion Brings Cross-Network Support to Wireless VoIP

All Rights Reserved. Legal Notices.
Created: Nov. 5, 1997
Revised: Jan. 18, 1998

URL: http://www.webreference.com/dhtml/column8/