Whenever the window’s width is less than the figure’s width, the
-40px
value for
figure.style.left
pushes the figure further left than it would normally be and aligns it
with the left side of most of the other material on the left side of the window. In narrow win-
dows, this provides the greatest possible view of the map. On the other hand, when
winWidth
equals or exceeds
figWidth
,
figure.style.left
takes on a value that centers the figure in
the window. For that code to work, the JavaScript engine relies on the figure object’s style prop-
erty. We’ll provide
an in-depth look at the
style
property in the next chapter.
Do'stlaringiz bilan baham: