HTML and CSS Reference
In-Depth Information
Creating a Window for the Image
Thefirst thingwearegoingtodoiscreate alogical window,thesize ofthecanvas, where our
image will reside. We will use the following two variables to control the dimensions of this
window:
var
var
windowWidth
=
500
;
var
var
windowHeight
=
500
;
We will also create two variables to define the current top-left corner for the window. When
we move on to the panning examples, we will modify these values to redraw the image based
on this location:
var
var
windowX
=
0
;
var
var
windowY
=
0
;