02.06.2013 Views

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

jQuery 1.4 Animation Techniques - Index of

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.

CSS3 <strong>Animation</strong>s<br />

Units<br />

It is <strong>of</strong> critical importance to note that some browsers, such as Firefox, expect<br />

these values with the units specified (as in the previous picture), while other<br />

browsers, such as Opera, or those based on the Webkit rendering engine, will<br />

expect these values without units.<br />

An element does not need to be positioned in order for it to be translated, and the transform<br />

does not affect the flow <strong>of</strong> the document, or other elements around it. Adjacent elements<br />

will position themselves according to an element's original location, not its new location<br />

following a translation. The translated element's content is also translated along with it.<br />

Scale<br />

You may be wondering why we supplied the value 1 as the first and fourth parameters in our<br />

first matrix code snippet, but 0 as the value <strong>of</strong> the second and third parameters instead <strong>of</strong><br />

supplying all zeros.<br />

The reason for this is because these parameters (the first and fourth) correspond to the<br />

scale transform function, so to retain the transformed element's original size, the scale<br />

parameters are set to 1. To double the size <strong>of</strong> an element (without translating its position),<br />

we could use the following transformation matrix:<br />

transform: matrix(2, 0, 0, 2, 0, 0);<br />

This snippet would be equivalent to using transform: scale(2, 2) and would cause the<br />

targeted element to appear like this:<br />

[ 234 ]

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

Saved successfully!

Ooh no, something went wrong!