spacer

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

home / experts / dhtml / column8
Developer News
Metasploit 3.2 Offers More 'Evil Deeds'
'Thank You Apple. Seriously.'
The Buzz: BlackBerry App Store Seen Next
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.


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
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview · Controllers: Programming Application Logic - Part 2 · How to Use JavaScript to Validate Form Data
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Choosing the Right Online Backup Provider · Mother Avaya Nurtures Her Technology Partners · Software as a Service a Winning Model for Hotspot Provider

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

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