278 Chapter 12—Finishing Touches:Some Global Attributes
Figure 12.1 Static basic layout of the 1-2-3-4! game
As you can see in the title bar in Figure 12.1, the screen shot was created
with a beta version of Firefox 4, because only that browser version meets the
requirements of the game. With the exception of data-*, for which we use Remy
Sharp’s JavaScript shim as mentioned earlier, all necessary attributes and
methods are implemented in this version.
12.5 Drag and Drop with the “draggable” Attribute
Drag and drop in the browser is really nothing new. This function has been pres-
ent in Internet Explorer (IE) since 1999, in version 5.0 at that time. Based on the
IE implementation, drag and drop was then included in the specification in 2005
and is now available in all common browsers, with the exception of Opera.
The checklist for the implementation of a classic drag-and-drop operation, as
used in the game for sorting the cities by number of inhabitants, involves the
following tasks:
- Selecting elements that can be dragged
- Determining data to be dragged along in the background as soon as the
drag-and-drop operation is started