15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

clip<br />

Compatibility ✓<br />

Chapter 15 ✦ The NN4 Layer Object (Chapter 31)<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Example<br />

Because of the edge movement behavior of adjustments to layerObject.clip<br />

properties, Listing 31-4 enables you to experiment with adjustments to each of the<br />

six properties. The document loads one layer that you can adjust by entering alternative<br />

values into six text fields — one per property. Figure 15-2 shows the page.<br />

Figure 15-2: Experiment with layer.clip properties.<br />

As you enter values, all properties are updated to show their current values (via<br />

the showValues() function). Pay particular attention to the apparent motion of the<br />

edge and the effect the change has on at least one other property. For example, a<br />

change to the layerObject.clip.left value also affects the layerObject.clip.<br />

width property value.<br />

Listing 31-4: Adjusting layer.clip Properties<br />

<br />

<br />

Layer Clip<br />

<br />

var origLayerWidth = 0<br />

var origLayerHeight = 0<br />

Continued<br />

447<br />

document.layerObject.clip

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!